update to codebook