wrote the implementation for the switch method under the main menu.