anchor.diff:            call get_excitation_degree(tmp_det,psi_non_ref(1,1,idx_alpha(l_sd)),degree,Nint)
             if (degree == 0) then
               
  -            loop = .True.
  -            do i_state=1,N_states
  -              if (lambda_mrcc(i_state,idx_alpha(l_sd)) /= 0.d0) then
  -                loop = .False.
  -                exit
  -              endif
  -            enddo
  +!             loop = .True.
  +!             do i_state=1,N_states
  +!               if (lambda_mrcc(i_state,idx_alpha(l_sd)) /= 0.d0) then
  +!                 loop = .False.
  +!                 exit
  +!               endif
  +!             enddo
  +            loop = .false.
               if (.not.loop) then
                 call get_excitation(psi_ref(1,1,i_I),psi_non_ref(1,1,idx_alpha(l_sd)),exc,degree,phase2,Nint)
                 hIl = hij_mrcc(idx_alpha(l_sd),i_I)
   !                             call i_h_j(psi_ref(1,1,i_I),psi_non_ref(1,1,idx_alpha(l_sd)),Nint,hIl)
                 do i_state=1,N_states
  -                dka(i_state) = hIl * lambda_mrcc(i_state,idx_alpha(l_sd)) * phase * phase2
  +                dka(i_state) = get_dij(psi_ref(1,1,i_I), psi_non_ref(1,1,idx_alpha(l_sd)), N_int) * phase * phase2 !hIl * lambda_mrcc(i_state,idx_alpha(l_sd)) * phase * phase2
                 enddo
               endif
   
  
positive.code:         
          ! Loop if lambda == 0
          logical                        :: loop
          loop = .True.
          do i_state=1,N_states
            if (lambda_mrcc(i_state,idx_alpha(k_sd)) /= 0.d0) then
              loop = .False.
              exit
            endif
          enddo
          if (loop) then
            cycle
          endif
          
          call get_excitation_degree(psi_ref(1,1,i_I),psi_non_ref(1,1,idx_alpha(k_sd)),degree,Nint)
          if (degree > 2) then
  
negative.code:   integer, allocatable           :: idx_microlist(:), N_microlist(:), ptr_microlist(:), idx_microlist_zero(:)
    integer :: mobiles(2), smallerlist
    logical, external :: detEq, is_generable
    double precision, external :: get_dij
  
    leng = max(N_det_generators, N_det_non_ref)
    allocate(miniList(Nint, 2, leng), tq(Nint,2,n_selected), idx_minilist(leng), hij_cache(N_det_non_ref))
  