Updated R script.