Brown hamburger and onions and drain. Mix with soup, beans and salt and pepper. Put in a flat dish or casserole. Make up the mashed potatoes following recipe on the box and spread on top of the hamburger mixture. Spread cheese over the top of the potatoes and bake at 350 degrees for 30 minutes.