Mix together 1/4 cup margarine, salt, pepper, onion, sour cream or whipping cream, soup and cheese. Blend well.
Butter 9 1/2 x 13 pan and place hash browns in bottom. Pour liquid mixture over hash browns.
Mix 1/4 cup margarine and then corn flakes and put on top of potato mixture. Bake at 350 degrees for 45 minutes.