Preheat oven to 375
Slice the potatoes so they are about 1/8 inch or less thick and set aside
Melt butter in saucepan over medium heat
Add onions and cook until tender, about 5 minutes
Add flour and salt and cook for another minute
Slowly add in milk, stir slowly
Cook until mixture has come to boil and thickened
Remove from heat and add half the cheese
Stir until melted
Layer half the potatoes in the 9x13 cooking dish
Spread half the sauce over the potatoes
Sprinkle half the remaining cheese over the sauce
Layer the rest of the potatoes in the cooking dish
Spread the remaining sauce over the potatoes
Sprinkle the remaining cheese over the sauce
Cover with foil and place it in the oven for 1 1/2 hours
Remove the foil and check to see if it's done
If it's close to being done (a fork easily goes into the potatoes, leave the foil off and continue to bake for about 20 minutes
If they don't feel close to done, put the foil back on and continue to cook for 20 minutes