Creating Codebook