adding code to print experimental output to file at the end of a run.