anchor.diff:    end if
     
     if(h1 + (s1-1)*mo_tot_num < h2 + (s2-1)*mo_tot_num) then
  -    f = searchExc(hh_exists(1,1), (/s1, h1, s2, h2/),  hh_shortcut(0))
  +    tmp_array = (/s1, h1, s2, h2/)
     else
  -    f = searchExc(hh_exists(1,1), (/s2, h2, s1, h1/), hh_shortcut(0))
  -  end if
  -  if(f == -1) return
  -  
  +    tmp_array = (/s2, h2, s1, h1/)
  +  end if
  +  f = searchExc(hh_exists(1,1), tmp_array,  hh_shortcut(0))
  +
     if(p1 + (s1-1)*mo_tot_num < p2 + (s2-1)*mo_tot_num) then
  -    f = searchExc(pp_exists(1,hh_shortcut(f)), (/s1, p1, s2, p2/), hh_shortcut(f+1)-hh_shortcut(f))
  +    tmp_array = (/s1, p1, s2, p2/)
     else
  -    f = searchExc(pp_exists(1,hh_shortcut(f)), (/s2, p2, s1, p1/), hh_shortcut(f+1)-hh_shortcut(f))
  -  end if
  -  
  -  if(f /= -1) is_generable = .true.
  +    tmp_array = (/s2, p2, s1, p1/)
  +  end if
  +  f = searchExc(pp_exists(1,hh_shortcut(f)), tmp_array, hh_shortcut(f+1)-hh_shortcut(f))
  +
  +  is_generable = (f /= -1) 
   end function
   
   
  
positive.code:   integer, external :: searchExc
    logical, external :: excEq
    double precision :: phase
    
    is_generable = .false.
    call get_excitation(det1, det2, exc, degree, phase, Nint)
  
negative.code:   end if
    
    if(h1 + (s1-1)*mo_tot_num < h2 + (s2-1)*mo_tot_num) then
      tmp_array = (/s1, h1, s2, h2/)
    else
      tmp_array = (/s2, h2, s1, h1/)
    end if
    f = searchExc(hh_exists(1,1), tmp_array,  hh_shortcut(0))
  
    if(f == -1) return
    
    if(p1 + (s1-1)*mo_tot_num < p2 + (s2-1)*mo_tot_num) then
      tmp_array = (/s1, p1, s2, p2/)
    else
      tmp_array = (/s2, p2, s1, p1/)
    end if
    t = searchExc(pp_exists(1,hh_shortcut(f)), tmp_array, hh_shortcut(f+1)-hh_shortcut(f))
  
    if(t /= -1) then
      get_dij = dIj_unique(t - 1 + hh_shortcut(f), s)
    end if
  