Added barebones exit function. Can be made cleaner later.