simplify menu loop and fix warnings

the way the menu stuff is done is a lot better now