Preheat oven to 350.
Thinly slice potatoes (I used mandoline slicer).
Butter a 9x11 baking dish.
In a large skillet, combine butter, onions, garlic and ham.
Cook over medium heat unil onions are softened.
Remove from heat.
In a medium bowl (make sure it will fit in microwave), combine cream, milk and pepper an heat for 1 minute.
Add flouir and whisk to combine.
Layer about 1/3 of the potato slices in the prepared dish.
Layer about 1/3 of the ham mixture on next.
Layer about 1/3 of the cheese.
Pour about 1/3 of the cream mixture on next.
Repeat this layering usinfg one third of each ingredient.
Cover with foil and bake for 60 minutes.
Remove the foil and bake uncovered for another 20 minutes until lightly browned.