minor changes to the R script