updates to R script