anchor.diff:    intsigave = 0d0
     do j=1,KLrnumRealz
       intsigave = intsigave + &
  -                KLrxi_integral(j,0d0,s)/KLrnumRealz/s
  +                KLrxi_integral(j,0d0,s,chxstype='total')/KLrnumRealz/s
     enddo
     500 format("  Integrator/reconstruction check - sigave: ",f8.5,"  intsigave: ",f8.5,"  relerr: ",es10.2)
     write(*,500) sigave,intsigave,abs(sigave-intsigave)/sigave
  
positive.code: 
  
  
    function KLrxi_integral(j,xl,xr)
    !This function integrates on KL reconstructed realizations from xl to xr.
    !Integration is always on total cross section, but 'material'- or 'totxs'-
    !cross sections are adjusted with or without meanadjust.
    use genRealzvars, only: lamc, sigave, Coscat, Coabs
    use KLvars, only: alpha, Ak, Eig, numEigs, KLrxivals, meanadjust, flmatbasedxs
  
    integer :: j
    real(8) :: xl,xr
    real(8) :: KLrxi_integral
  
    integer :: curEig
    real(8) :: Eigfintterm, Coterm
  
    if(flmatbasedxs) then
      Coterm = (sqrt(Coscat)+sqrt(Coabs))**2
    elseif(.not.flmatbasedxs) then
      Coterm = 1.0d0
    endif
  
    KLrxi_integral = 0d0
    do curEig=1,numEigs
      Eigfintterm = Eigfuncint(Ak(curEig),alpha(curEig),lamc,xl,xr)
      KLrxi_integral = KLrxi_integral + sqrt(Eig(curEig)) * &
                                             Eigfintterm * KLrxivals(j,curEig)
    enddo
    KLrxi_integral = (sigave + meanadjust) * (xr - xl) + (sqrt(Coterm) * KLrxi_integral)
  
    end function KLrxi_integral
  
  
negative.code:       do
          !find next point and area between these two
          xr = findnextpoint(j)
          areacont = KLrxi_integral(j,xl,xr,chxstype='total')/KLrnumRealz/s
  
          !calc aveposarea for tol check, also negstat tallies
          xmid = KLrxi_point(j,(xr+xl)/2d0,chxstype='total')
  