updated the codebook