Added the removeDuplicates method