fixing doubly linked implementation and tests