Combine potatoes. onions, salt and pepper. In non-stick skillet, put in a 2-3 tbsp of margarine, enough that when melted there is a layer in the skillet. Add shredded potatoes and onions.
Press down, let cook for a bit until brown on one side, then cut into section and flip over and press whole thing down again. When that side is brown, flip and press again, add milk, lower heat to low, and cover until milk is all absorbed, add cheese on top.
Remove from heat and cover for a few minutes until cheese is melted and has worked its way into the potatoes.