updated run_analysis.R to write output to file