minor update of the R script