Fixed bug in menu and added some comments