printToFile updated

Updated the printToFile method.