Codebook+ code working explanation