fixed all the bugs, added doubly linked list