added function to save results to file