Changed .good() to .eof() style loop; fixed trailing newline on cat function