changed return to exit, added comments