changed print to sys.stderr.write()
changed print to sys.stderr.write()