anchor.diff:    integer                        :: N_miniList, ni, leng
     double precision, allocatable  :: hij_cache(:)
     
  +  integer(bit_kind), allocatable :: microlist(:,:,:), microlist_zero(:,:,:)
  +  integer, allocatable           :: idx_microlist(:), N_microlist(:), ptr_microlist(:), idx_microlist_zero(:)
  +  integer :: mobiles(2), smallerlist
  +  
  +  
     
     leng = max(N_det_generators, N_det_non_ref)
  -  allocate(miniList(Nint, 2, leng), idx_miniList(leng), hij_cache(N_det_non_ref))
  +  allocate(miniList(Nint, 2, leng), idx_minilist(leng), hij_cache(N_det_non_ref))
     
     !create_minilist_find_previous(key_mask, fullList, miniList, N_fullList, N_miniList, fullMatch, Nint)
     call create_minilist_find_previous(key_mask, psi_det_generators, miniList, i_generator-1, N_miniList, fullMatch, Nint)
  
positive.code:   ! |alpha>
    
    if(N_tq > 0) then
      call create_minilist(key_mask, psi_non_ref, miniList, idx_miniList, N_det_non_ref, N_minilist, Nint)
    end if
    
    
    do i_alpha=1,N_tq
      !    call get_excitation_degree_vector(psi_non_ref,tq(1,1,i_alpha),degree_alpha,Nint,N_det_non_ref,idx_alpha)
      call get_excitation_degree_vector(miniList,tq(1,1,i_alpha),degree_alpha,Nint,N_minilist,idx_alpha)
      
      do j=1,idx_alpha(0)
        idx_alpha(j) = idx_miniList(idx_alpha(j))
      end do
      
      do l_sd=1,idx_alpha(0)
        k_sd = idx_alpha(l_sd)
  
negative.code:   double precision, intent(inout) :: delta_ii_(Nstates,Ndet_ref)
  
    integer(bit_kind), intent(in)  :: det_buffer(Nint,2,n_selected)
    integer                        :: i,j,k,l,m
    integer                        :: degree_alpha(psi_det_size), degree_alpha_tmp(psi_det_size)
    integer                        :: idx_alpha(0:psi_det_size), idx_alpha_tmp(0:psi_det_size)
    logical                        :: good, fullMatch
  
    integer(bit_kind)              :: tq(Nint,2,n_selected)
  