write results to file