Added codebook and fixed column bug