Fileoutput

Updated printToFile method.