add code for double linked list