anchor.diff:              pb.PutVarint(int64 vlen)
               pb.PutStream(ba, int vlen)
   
  -    let private buildOverflowFirstPage (pb:PageBuilder) (ba:Stream) len sofar =
  -        pb.Reset()
  -        pb.PutByte(OVERFLOW_NODE)
  -        pb.PutByte(0uy) // starts 0, may be changed before the page is written
  -        // check for the partial page at the end
  -        let num = Math.Min((pb.PageSize - (2 + sizeof<int32>)), (len - sofar))
  -        pb.PutStream(ba, num)
  -        // something will be put in lastInt32 before the page is written
  -        sofar + num
  -
  -    let private writeOverflowRegularPages (pb:PageBuilder) (fs:Stream) (ba:Stream) numPagesToWrite len _sofar =
  -        let rec fn i sofar =
  -            if i < numPagesToWrite then
  -                pb.Reset()
  -                // check for the partial page at the end
  -                let num = Math.Min(pb.PageSize, (len - sofar))
  -                pb.PutStream(ba, num)
  -                pb.Flush(fs)
  -                fn (i+1) (sofar + num)
  -            else
  -                sofar
  -
  -        fn 0 _sofar
  -
  -    let private buildOverflowBoundaryPage (pb:PageBuilder) (ba:Stream) len sofar =
  -        pb.Reset()
  -        // check for the partial page at the end
  -        let num = Math.Min((pb.PageSize - sizeof<int32>), (len - sofar))
  -        pb.PutStream(ba, num)
  -        // something will be put in lastInt32 before the page is written
  -        sofar + num
  -
  -    let private countOverflowPagesFor pageSize len = 
  -        let pages = len / pageSize
  -        let extra = if (len % pageSize) <> 0 then 1 else 0
  -        pages + extra
  -
       let private writeOverflow (pageManager:IPages) token startingNextPageNumber startingBoundaryPageNumber (pb:PageBuilder) (fs:Stream) (ba:Stream) =
           let len = (int ba.Length)
  -
  -        let rec fn sofarBeforeFirstPage firstPageNumber boundaryPageNumber :int*int =
  +        let pageSize = pb.PageSize
  +
  +        let buildBoundaryPage sofar =
  +            pb.Reset()
  +            // check for the partial page at the end
  +            let num = Math.Min((pageSize - sizeof<int32>), (len - sofar))
  +            pb.PutStream(ba, num)
  +            // something will be put in lastInt32 before the page is written
  +            sofar + num
  +
  +        let buildFirstPage sofar =
  +            pb.Reset()
  +            pb.PutByte(OVERFLOW_NODE)
  +            pb.PutByte(0uy) // starts 0, may be changed before the page is written
  +            // check for the partial page at the end
  +            let num = Math.Min((pageSize - (2 + sizeof<int32>)), (len - sofar))
  +            pb.PutStream(ba, num)
  +            // something will be put in lastInt32 before the page is written
  +            sofar + num
  +
  +        let writeRegularPages numPagesToWrite _sofar =
  +            let rec fn i sofar =
  +                if i < numPagesToWrite then
  +                    pb.Reset()
  +                    // check for the partial page at the end
  +                    let num = Math.Min(pageSize, (len - sofar))
  +                    pb.PutStream(ba, num)
  +                    pb.Flush(fs)
  +                    fn (i+1) (sofar + num)
  +                else
  +                    sofar
  +
  +            fn 0 _sofar
  +
  +        let countRegularPagesNeeded siz = 
  +            let pages = siz / pageSize
  +            let extra = if (siz % pageSize) <> 0 then 1 else 0
  +            pages + extra
  +
  +        let rec writeOneBlock sofarBeforeFirstPage firstPageNumber boundaryPageNumber :int*int =
               // each trip through this loop will write out one
               // block, starting with the overflow first page,
               // followed by zero-or-more "regular" overflow pages,
  
positive.code:             if sofarBeforeFirstPage >= len then
                  (firstPageNumber, boundaryPageNumber)
              else
                  let sofarAfterFirstPage = buildOverflowFirstPage pb ba len sofarBeforeFirstPage
                  // note that we haven't flushed this page yet.  we may have to fix
                  // a couple of things before it gets written out.
                  if firstPageNumber = boundaryPageNumber then
  
negative.code:                         // these don't have a header, and they don't have a
                          // boundary ptr at the end.
  
                          let sofarAfterRegularPages = writeRegularPages numRegularPages sofarAfterFirstPage
  
                          if needed > availableBeforeBoundary then
                              // assert sofar < len
  