working on the output file