anchor.diff:        do
           !find next point and area between these two
           xr = findnextpoint(j)
  -        areacont = KLrxi_integral(j,xl,xr)/KLrnumRealz/s
  +        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')
  
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: 
  
    function KLrxi_point(j,xpos,chxstype,tnumEigsin) result(KL_point)
    !Evaluates KL reconstructed realizations at a given point.
    !It has options for total, scattering only, absorption only, or scattering ratio.
    !It has an option to solve for less than the available number of eigenvalues.
    !It can function when in 'material'-based or 'totxs'-based mode.
    !It can function when adjusting mean or not adjusting mean.
    use genRealzvars, only: lamc, scatrat, Coscat, Coabs, sigscatave, sigabsave, &
                            sigave
    use KLvars, only: alpha, Ak, Eig, numEigs, KLrxivals, meanadjust, flmatbasedxs, &
  