sort a linked list