improve codebook