saving results in a file
saving results in a file: tidy up