actually write out data in output file