fixed sink
added header in output file