add doubly linked list and fix stupid bug