Added a main menu and state machine.