made some trivial changes in R codes