R code changes