sorted menu and cleaned the code

Tide up main menu in the code