harmless removing of comments, etc
more removal of unecessary stuff
removing some spaghetti... i was hungry.
added an exit handler... this needs to be tested.