cleanup

tidied up a bit mostly. added a throw statement in each catch to kill
the script on windows when there's an error or the user kills the
process, instead of it spinning on on and on.