updating R script