adding the codebook