Place the sliced potatoes and onions into a medium-sized pot. Add 1 teaspoon salt and enough water to cover the potatoes.
Cook over medium-high heat for about 10 minutes until the potatoes are fork tender.
Drain, and transfer the potatoes to a small baking dish.
To prepare the sauce, add the butter and flour to a medium-sized pot over medium heat to make a roux. Cook for about a minute, stirring often, until the roux begins to smell like pie crust.
Add a third of the milk and stir until the mixture thickens.
Add the next third of the milk and stir until it thickens again.
Repeat with the remaining milk.
Season the resulting sauce with 1/2 teaspoon of salt and the black pepper.
Pour the sauce over the potatoes in the baking dish and top with shredded cheese if desired.
Bake for approximately 25 minutes or until the top begins to brown.