codebook edits; need to revisit arguments for avgdata()