anchor.diff:  
       end do
   
  -    iini = 1
  -
  -    iend = nTItems
  -
  -    nItems = nTItems
  -
  -    iType   => iType_(iini:iend)
  -
  -    iNumber => iNumber_(iini:iend)
  -
  -    iLength => iLength_(iini:iend)
  -
  -    iWidth  =>  iWidth_(iini:iend)
  +    call updateCurrItems(1, nTItems)
  +
  +!!$    iini = 1
  +!!$
  +!!$    iend = nTItems
  +!!$
  +!!$    nItems = nTItems
  +!!$
  +!!$    ! Initialize common pointers
  +!!$
  +!!$    iType   => iType_(iini:iend)
  +!!$
  +!!$    iNumber => iNumber_(iini:iend)
  +!!$
  +!!$    iLength => iLength_(iini:iend)
  +!!$
  +!!$    iWidth  =>  iWidth_(iini:iend)
   
       deallocate(types, tL, tW)
   
  
positive.code: 
      ! Update the number of items and selected items
  
      nItems = pos
  
      iend = iini + nItems - 1
  
      iType   => iType_(iini:iend)
  
      iNumber => iNumber_(iini:iend)
  
      iWidth  => iWidth_(iini:iend)
  
      iLength => iLength_(iini:iend)
  
    end subroutine extractBoxes
  
  
negative.code: 
      end if
  
  !!$    iini = iini + nit
  !!$
  !!$    iend = nTItems
  !!$
  !!$    nItems = iend - iini + 1
  !!$
  !!$    iType   => iType_(iini:iend)
  !!$
  !!$    iNumber => iNumber_(iini:iend)
  !!$
  !!$    iWidth  => iWidth_(iini:iend)
  !!$
  !!$    iLength => iLength_(iini:iend)
  
      call updateCurrItems(iini + nit, nTItems)
  
    end subroutine removeItems
    
  ! ******************************************************************
  ! ******************************************************************
  
    subroutine updateCurrItems(niini, niend)
  
      ! This subroutine updates which items are currently being
      ! considered for optimization and packing.
  
      implicit none
  
      ! SCALAR ARGUMENTS
      integer, intent(in) :: niini, niend
  
      iini = niini
  
      iend = niend
  
      nItems = iend - iini + 1
  
      iType   => iType_(iini:iend)
  
      iNumber => iNumber_(iini:iend)
  
      iWidth  => iWidth_(iini:iend)
  
      iLength => iLength_(iini:iend)
  
    end subroutine updateCurrItems
  
  ! ******************************************************************
  ! ******************************************************************
  
  