add codes to codebook