exit is now working and passes all test cases