Update to codebook, correcting variables