Update the codebook