Saute butter and onions in a large pot until onions are clear. Whisk in flour until lumps are gone. Add milk slowly whisking the entire time to avoid lumps and cook until it thickens to a sauce. Remove from heat and add cheese and stir until lumps are gone. Arrange potatoes in a large roasting pan and pour cheese sauce over the top. Bake covered at 375 for 1 1/2 hours or until potatoes are cooked. When potatoes are cooked remove lid and cook for 30 minutes to brown the top.