Added method to remove duplicates in LinkedList