anchor.diff:      do ni=1,N_int
         do i=0,bit_kind_size-1
           if(BTEST(det(ni, s), i)) change = .not. change
  -          if(change) phasemask((ni-1)*bit_kind_size + i + 1, s) = 1_1
  +          if(change) phasemask(s, (ni-1)*bit_kind_size + i + 1) = 1_1
         end do
       end do
     end do
  
positive.code:   use bitmasks
    implicit none
  
    integer(1), intent(in) :: phasemask(N_int*bit_kind_size, 2)
    integer, intent(in) :: s1, s2, h1, h2, p1, p2
    logical :: change
    integer(1) :: np
    double precision, parameter :: res(0:1) = (/1d0, -1d0/)
  
    np = phasemask(h1,s1) + phasemask(p1,s1) + phasemask(h2,s2) + phasemask(p2,s2)
    if(p1 < h1) np = np + 1_1
    if(p2 < h2) np = np + 1_1
    
    if(s1 == s2 .and. max(h1, p1) > min(h2, p2)) np = np + 1_1
    get_phase_bi = res(iand(np,1_1))
  end 
  
  
  
negative.code:   implicit none
  
    integer(bit_kind), intent(in) :: gen(N_int, 2), mask(N_int, 2)
    integer(1), intent(in) :: phasemask(2,N_int*bit_kind_size)
    logical, intent(in) :: bannedOrb(mo_tot_num, 2), banned(mo_tot_num, mo_tot_num,2)
    integer(bit_kind) :: det(N_int, 2)
    double precision, intent(in) :: coefs(N_states)
  