Preheat oven to 350°F. Grease a two quart casserole. In a medium saucepan, cover potatoes with water and boil until tender (about 15 minutes) and drain. In a medium skillet cook bacon until crisp. Drain and reserve two tablespoons of drippings. Saute chopped onion in drippings until translucent. Sprinkle potatoes with salt and pepper, and gently toss with onions. Layer half the potatoes in casserole, sprinkle with one tablespoon of flour. Dot with half of the butter. Top with half of the cheese. Repeat process in the same order with remaining ingredients. Pour milk over the potato layers and sprinkle on bacon bits last. Bake for one hour or until heated thoroughly.