write results into file