Updated R code for peer assessment