merge sort for linked list