remove printf and change stdout to STDOUT