flushing stdout report and working in 3 dimensions