modifying codebook