write results to files