added (and commented out) codes to output timestamp, dist, and diff to files