updating R code and including some images