cleaned up main menu code