duplication counting and marking

counts during build and marks during print