Updated readme and added comments to R code