changes for detecting duplicates in linked list.