test
optimze the data and codebook
optimze