Add algo to markDuplicate.