Updated code

Made small changes to the R script to make sure thing were right.