Rearranged code, added menu items in panorama