added basic quit function

basic quit function added to first input
Merge pull request #1 from bspymaster/safe-quit-function

added basic quit function to the code for safe exiting