formatting to codebook