add data and codebook