optimization
final codebooks
bug fix