updated to use doubly linked list

improves performance when adding to the end