added comments to R script