assn_1 part 2 complete.R working