included function to save files for each problem