anchor.diff:  
   print *,"new samps M_optsamps(1,:):",M_optsamps(1,:)
   print *,"new samps M_optsamps(2,:):",M_optsamps(2,:)
  +print *,"new samps M_optsamps(3,:):",M_optsamps(3,:)
     do ilevel = 0,Level                                          !search each level
   print *,"ilevel:",ilevel
       if( M_optsamps(1,ilevel)>M_optsamps(2,ilevel) ) then       !if new samps to compute
  
positive.code: 
  
  
    !2 Using M~(current samples) solve V~(estimated variance) for each level L
  !  subroutine MLMCsolveEstVar( Level )
  
  
  !  end subroutine MLMCsolveEstVar
  
    !3 Using V~s(estimated variance), compute optimal M~s(estimated opt num of samples)
    subroutine MLMCcomputeOptSamps( Level )
    use MLMCvars, only: MLMC_TOLsplit, MLMC_TOL, C_alpha, Gave, Gvar, M_optsamps, &
  
negative.code: 
    !add new Level to M_optsamps and populate it
    call move_alloc(M_optsamps,tiarray2)
    allocate(M_optsamps(3,0:size(tiarray2(1,:))))
    M_optsamps = 0
    M_optsamps(:,0:size(tiarray2(1,:))-1) = tiarray2
    M_optsamps(1,Level) = bnumMLMCsamps
  