added exit method and error methods. Created new method to loop application