added codebook visualization