write script for codebook