Saving codebook cleaned up