writing results to separate output files