   # When we read a leaf page file, if we read from the back of the file toward
   # the front, we can read backward until we find a position array entry. Then
   # we can read forward to the end of the file, applying the inserts and deletes
-  # that occurred after we wrote the position array entry. 
-  # 
+  # that occurred after we wrote the position array entry.
+  #
   # When a leaf page file is large, stashing the constructed position array at
   # the end means that the leaf page can be loaded quickly, because we will only
   # have to read backwards a few entries to find a mostly completed position

      # We create linked lists that contain the leaf pages we're considering in
      # our balance plan. This is apart from the most-recently used list that
      # the pages themselves form.
      # 
      # The linked list nodes contain a reference to the page, plus a reference
      # to the node containing the previous sibling, and a reference to the node
      # containing the next sibling. If a sibling is not participating in our
      # balance plan, then its link is null. This gives us one or more linked
      # lists that reference a series of leaf pages ordered according to their
      # order in the b&#x2011;tree.
      # 
      # We are always allowed to get a lock on a single page, so long as we're
      # holding no other locks.
      if not node = ordered[address]

    # page size. When we detect that we can't make an informed decision on a
    # page, we pass it onto the next balancer for consideration at the next
    # balance.

    # For each page that has changed we add it to a doubly linked list.
    ordered = {}
    for address in addresses
