added summary and R code