The clunky R code for Assignment 2 that may get some results