couple new imports for basic exception handling. function get_safe_int() catches spurious inputs and only returns an int. program exits gracefully without traceback to stdout on exceptions.