Replaced printf abuse with putchar, puts, and fputs as necessary