Implemented basic duplicate counter.