Modify singly linked list and add doubly linked list