refactored linked list, working with doublelinkedlist