codebook updates and edits
decided to use reshape2 library