added codebook.r