anchor.diff:              do j = 0, i0_end
                   if (btest(f(i), j)) then
                       iocc = iocc + 1
  -                    occ_list(iocc) = basis_lookup(j, i)
  +                    d%occ_list(iocc) = basis_lookup(j, i)
                   else
                       if (mod(j,2)==0) then
                           ! alpha state
                           iunocc_a = iunocc_a + 1
  -                        unocc_list_alpha(iunocc_a) = basis_lookup(j, i)
  +                        d%unocc_list_alpha(iunocc_a) = basis_lookup(j, i)
                       else
                           ! beta state 
                           iunocc_b = iunocc_b + 1
  -                        unocc_list_beta(iunocc_b) = basis_lookup(j, i)
  +                        d%unocc_list_beta(iunocc_b) = basis_lookup(j, i)
                       end if
                   end if
                   ! Have we covered all basis functions?
  
positive.code:         !    f(basis_length): bit string representation of the Slater
          !        determinant.
          ! Out:
          !    occ_list(nel): integer list of occupied spin-orbitals in the Slater determinant.
          !    unocc_list_alpha(nvirt_alpha): integer list of unoccupied alpha
          !        spin-orbitals in the Slater determinant.
          !    unocc_list_beta(nvirt_beta): integer list of unoccupied beta
          !        spin-orbitals in the Slater determinant.
  
          integer(i0), intent(in) :: f(basis_length)
          integer, intent(out) :: occ_list_alpha(nalpha), occ_list_beta(nbeta)
          integer, intent(out) :: unocc_list_alpha(nvirt_alpha), unocc_list_beta(nvirt_beta)
          integer :: i, j, iocc_a, iocc_b, iunocc_a, iunocc_b
  
          iocc_a = 0
  
negative.code:                     if (mod(j,2)==0) then
                          ! alpha state
                          iocc_a = iocc_a + 1
                          d%occ_list_alpha(iocc_a) = basis_lookup(j, i)
                      else
                          ! beta state
                          iocc_b = iocc_b +1
                          d%occ_list_beta(iocc_b) = basis_lookup(j, i)
                      end if
                  else
                      if (mod(j,2)==0) then
                          ! alpha state
                          iunocc_a = iunocc_a + 1
                          d%unocc_list_alpha(iunocc_a) = basis_lookup(j, i)
                      else
                          ! beta state 
                          iunocc_b = iunocc_b + 1
                          d%unocc_list_beta(iunocc_b) = basis_lookup(j, i)
                      end if
                  end if
                  ! Have we covered all basis functions?
  