Added file output routine