implementation of doubly linked list