Make duplicate removal functional