Remove print statement
move flush call
A little reorganisation