anchor.diff:          if (get_rand_close_open(rng) < excit_gen_data%pattempt_single) then  
               ! We have a single
               associate( pp => excit_gen_data%excit_gen_pp )
  -                ! 2b. Select orbitals to excite from
  +                ! 2. Select i_ref.
                   
                   i_ind_ref = select_weighted_value_precalc(rng, sys%nel, pp%ppn_i_s%aliasU(:), pp%ppn_i_s%aliasK(:))
                   i_ref = pp%occ_list(i_ind_ref)
                   
  -                ! Now map i_ref to i_cdet.
  +                ! 3. Now map i_ref to i_cdet.
                   call get_excitation_locations(pp%occ_list, cdet%occ_list, ref_store, cdet_store, sys%nel, nex)
                   ! These orbitals might not be aligned in the most efficient way:
                   !  They may not match in spin, so first deal with this
  
positive.code:                     if ((a_cdet /= b_cdet) .and. .not. btest(cdet%f(sys%basis%bit_lookup(2,b_cdet)), &
                          sys%basis%bit_lookup(1,b_cdet))) then
                          
                          ! 3b. Probability of generating this excitation.
  
                          ! Calculate p(ab|ij) = p(a|i) p(j|b) + p(b|i)p(a|j)
                          if (ij_spin == 0) then
  
negative.code:                     end if
                  end do
                  
                  ! 4. Find j_ref.
                  ! j is chosen from set of occupied spinorbitals in reference but with weights calculated for i_cdet.
                  j_ind_ref = select_weighted_value_precalc(rng, sys%nel, pp%ppn_ij_d%aliasU(:,i_cdet), &
                                                      pp%ppn_ij_d%aliasK(:,i_cdet))
                  j_ref = pp%occ_list(j_ind_ref)
  
                  ! 5. Map j_ref to j_cdet.
                  j_cdet = j_ref
                  do ii=1, nex
                      if (ref_store(ii) == j_ind_ref) then  ! j_ref isn't actually in cdet, so we assign j_cdet to the orb that is
  