fixed idention bugs as well as the menu logic. moved key_map to main routine.