Keep the main stack as a doubly linked list.