Adding code and codebook