Change output code to use PrintStream.