adding  codebook