modified R code files necessary for programming assignment 3