change to using sys.exit codes