run_analysis with comments and some big fixes and cleanup