updates to codebook