Finished main code of the menu