made updates to R script and codebook