refactored queue to use doubly linked list