Completed the menu logic