fixed small errors and menu and cleaned up code