singly linked list changed to doubly linked list. merge sort rewritten