started the function to save the finalreport.txt file