Preheat oven to 350.
Layer sliced potatoes in a 9x13 baking dish.
Over medium heat, melt butter in a small saucepan. Add onion and saute until soft and translucent.
Add arrowroot powder, salt, pepper, and thyme (and bacon, if you're adding it). Stir to combine.
Add the milk and cook over medium-high heat until the mixture starts bubbling lightly and thickens; stir frequently.
As soon as it's thickened, remove from heat and pour over potatoes. Add cheese on top (if you're using it). Bake for 45 - 60 minutes, until potatoes are soft.