Preheat oven to 180 degrees Celsius
Peel and slice the potatoes into thin rounds. You can add a few drops of water to the sliced potatoes and microwave them for 5 minutes if you wish
In a small saucepan melt the butter. Add the onion, thyme and garlic and saute on a low heat until the onion is translucent
Stir in the flour and cook for a minute, stirring with a whisk
Add the milk and whisk, ensuring there's no lumps
Simmer on low heat until sauce thickens. Stir occasionally
Season with salt and pepper and a pinch of cayenne pepper
In an ovenproof dish layer half the potatoes at the bottom of the dish. Pour half the sauce over, place the remaining potatoes on top and pour the remaining sauce. Sprinkle the parmesan on top. Bake at 180 degrees Celsius for 45minutes to 1 hour.