Fix! final commit.
clean up output
fix bugs in iterating and writing cpd
yeah!