adds original linked list traversal code