Added plots and completed R code