cleared main program loop