add final data and codebook