splitting a linked list