Did some modifications on the removeDuplicates file