added corr.R to aswer part 3 of the assignment