deduplicate linked list