added exit, initial tests appear to be robust