Last R code from Luca