extend the print class to output to a file