R code

corrections