adding finalized R code and CodeBook