Added ability to write to outputFile