R code moved to ./R directory