modified R script file with code