Simple implementation of doubly linked list in c++