duplicate removal functionality