added comments to R code