store codebook as char not double