Replaced sys.stdout.flush()