Changed the file output mechanism