another update to the R code