added an R section to the script to illustrate what we have done