making alterations to R script