Added main menu and code clean up