write output to output file