remove duplicates method added to Linked List class