final draft of assignment 2 .Rmd file