Preheat oven to 400 degrees F. Butter an 11x7-inch baking pan. Peel and slice potatoes into 1/4-inch rounds. Heat milk to a near boil. Layer half the potatoes in the baking pan, sprinkle with salt and pepper, dot with butter, and add half the cheese, onions, and flour. Then repeat the layering, but set aside the final half-cup of cheese. Pour hot milk over all, cover with foil, and bake for 45 minutes. Sprinkle with remaining cheese, and bake for another 15 minutes.