updated including codebook