remove printf and use fputs twice