fixing codebook2