anchor.diff:    integer, intent(out) :: N_microlist(0:mo_tot_num*2), ptr_microlist(0:mo_tot_num*2+1), idx_microlist(N_minilist*4)
     integer(bit_kind), intent(out) :: microlist(Nint,2,N_minilist*4)
     
  +  integer, intent(out) :: N_tmicrolist(0:mo_tot_num*2), ptr_tmicrolist(0:mo_tot_num*2+1), idx_tmicrolist(N_minilist*4)
  +  integer(bit_kind), intent(out) :: tmicrolist(Nint,2,N_minilist*4)
  +  
     integer :: i,j,k,s,nt,n_element(2)
  -  integer :: list(Nint*bit_kind_size,2), cur_microlist(0:mo_tot_num*2+1)
  +  integer :: list(Nint*bit_kind_size,2), cur_microlist(0:mo_tot_num*2+1), cur_tmicrolist(0:mo_tot_num*2+1)
     integer(bit_kind) :: key_mask_neg(Nint,2), mobileMask(Nint,2)
     integer :: mo_tot_num_2
     mo_tot_num_2 = mo_tot_num+mo_tot_num
  
positive.code:           double precision :: i_H_psi_value(N_states), i_H_psi_value2(N_states)
            i_H_psi_value = 0d0
            i_H_psi_value2 = 0d0
            integer :: sporb
  !           call i_H_psi(exc_det,psi_selectors,psi_selectors_coef,N_int,N_det_selectors,psi_selectors_size,N_states,i_H_psi_value)
            
  !           call check_past(exc_det, microlist(1,1,ptr_microlist(sporb)), idx_microlist(ptr_microlist(sporb)), N_microlist(sporb), i_generator, nok, N_int)
  !           if(nok) cycle
  !           
  !           call check_past(exc_det, microlist, idx_microlist, N_microlist(0), i_generator, nok, N_int)
  !           if(nok) cycle
  !           
  
            if(N_microlist(0) > 0) call i_H_psi(exc_det,microlist,psi_coef_microlist,N_int,N_microlist(0),psi_selectors_size*4,N_states,i_H_psi_value)
            if(N_microlist(sporb) > 0) call i_H_psi(exc_det,microlist(1,1,ptr_microlist(sporb)),psi_coef_microlist(ptr_microlist(sporb), 1),N_int,N_microlist(sporb),psi_selectors_size*4,N_states,i_H_psi_value2)
            i_H_psi_value = i_H_psi_value + i_H_psi_value2
            double precision :: Hii, diag_H_mat_elem_fock
            Hii = diag_H_mat_elem_fock(psi_det_generators(1,1,i_generator),exc_det,fock_diag_tmp,N_int)
            double precision :: delta_E, e_pert
  
negative.code:     
      if(nt > 4) then !! TOO MANY DIFFERENCES
        continue
      else if(nt < 3) then
        if(i < i_cur) then
          N_microlist = 0  !!!! PAST LINKED TO EVERYBODY!
          ptr_microlist = 1
          N_tmicrolist = 0  !!!! PAST LINKED TO EVERYBODY!
          ptr_tmicrolist = 1
          return  
        else
          N_microlist(0) = N_microlist(0) + 1
        endif
      else
        call bitstring_to_list(mobileMask(1,1), list(1,1), n_element(1), Nint)
        call bitstring_to_list(mobileMask(1,2), list(1,2), n_element(2), Nint)
        
        do s=1,2
          do j=1,n_element(s)
            k = list(j,s) + mo_tot_num * (s-1)
            if(nt == 4) N_microlist(k) = N_microlist(k) + 1
            if(nt == 3) N_tmicrolist(k) = N_tmicrolist(k) + 1
          end do
        end do
      endif
    end do
    
    ptr_microlist(0) = 1
    ptr_tmicrolist(0) = 1
    do i=1,mo_tot_num_2+1
      ptr_microlist(i) = ptr_microlist(i-1) + N_microlist(i-1)
      ptr_tmicrolist(i) = ptr_tmicrolist(i-1) + N_tmicrolist(i-1)
    end do
  
    do i=0,mo_tot_num_2+1
      cur_microlist(i) = ptr_microlist(i)
      cur_tmicrolist(i) = ptr_tmicrolist(i)
    end do
    
    
  