counts items, removes dupes