private PairNode<T> compareAndLink( PairNode<T> first, PairNode<T> second )
 {
     if( second == null )
         return first;

     if( second.element.compareTo( first.element ) < 0 )
     {
         // Attach first as leftmost child of second
         second.prev = first.prev;
         first.prev = second;
         first.nextSibling = second.leftChild;
         if( first.nextSibling != null )
             first.nextSibling.prev = first;
         second.leftChild = first;
         return second;
     }
     else
     {
         // Attach second as leftmost child of first
         second.prev = first;
         first.nextSibling = second.nextSibling;
         if( first.nextSibling != null )
             first.nextSibling.prev = first;
         second.nextSibling = first.leftChild;
         if( second.nextSibling != null )
             second.nextSibling.prev = second;
         first.leftChild = second;
         return first;
     }
 }