Cleanup
Cleanup unused memory
Return and handle exit condition