ERROR for case 5,6 terminal_sequence should be outside while(1) loop
Cosmetic changes
reinstated test of status_run in case 5,6