In a 9 x 13-inch baking dish, put a layer of potatoes, then a layer of onions. Cover the layer with 2 tablespoons flour, 1 teaspoon salt, half the pepper, and 4 tablespoons butter. Repeat with rest of potatoes, onions, butter, flour, salt and pepper. Pour milk over potatoes. If using whole milk, heat to warm and pour over potatoes. Bake at 350° until potatoes are tender and milk is absorbed. Stir potatoes mixture 2 or 3 times during baking to absorb flour and milk mixture. If the potatoes are dry, add more milk.