fix codebook formating