flushing stdout, removing debugging statements