Added the code in the R file