Updated R script and added required files