traversing a linked list with recursion