anchor.diff:          !    connection: the excitation connection between the parent and child
           !                determinants
   
  -    end subroutine ct_spawn
  -    
  +        use excitations, only: enumerate_all_excitations
  +        use dSFMT_interface, only: genrand_real2
  +        use system, only: ndim, nel
  +
  +        type(det_info), intent(in) :: det
  +        integer, intent(in) :: parent_sgn
  +        real(p), intent(in) :: K_ii, matel
  +        
  +        integer, intent(out) :: nspawned
  +        type(excit), intent(out) :: connection
  +        
  +        real(p) :: rand, test, R_ii, R, abs_matel
  +        integer :: num_excitations
  +        type(excit) :: connection_list(2*ndim*nel)
  +
  +        R_ii = abs(H_ii)
  +        abs_matel = abs(matel)
  +        call enumerate_all_excitations_real(d, num_excitations, connection_list)
  +        R = R_ii + matel*num_excitations
  +        rand = genrand_real2()*R
  +
  +        if (rand < R_ii) then
  +            connection%nexcit = 0 ! spawn onto the same determinant (death/cloning)
  +            if (K_ii < 0) then    ! child is same sign as parent
  +                nspawned = sign(1,parent_sgn)
  +            else if (K_ii > 0) then
  +                nspawned = -sign(1,parent_sgn)
  +            else
  +                nspawned = 0
  +            end if
  +        else
  +            test = R_ii
  +            do j = 2, nexcit
  +                test = test + abs_matel
  +                if (rand < test) then
  +                    if (K_ii < 0) then ! child is same sign as parent
  +                        nspawned = sign(1,parent_sgn)
  +                    else if (K_ii > 0)
  +                        nspawned = -sign(1,parent_sgn)
  +                    else
  +                        nspawned = 0
  +                    end if
  +                    connection = connection_list(j)
  +                    exit
  +                end if
  +            end do
  +        end if
  +
  +    end subroutine ct_spawn_real
  +
   
       subroutine create_spawned_particle_ct(d, connection, time, nspawned, spawned_pop)
   
  
positive.code:                 if(all(current_pos == spawning_head+1)) exit
                  
              end do
          end do
  
      end subroutine do_tc_fciqmc
  
      
      subroutine ct_spawn(d, parent_sgn, nspawned, connection)
      
          ! randomly select a (valid) excitation from the current determinant
          ! stored in "d"
          !
          ! In: 
          !    d: info on current determinant that we will spawn from.
          !    parent_sgn: sgn on the parent determinant (i.e. +ve or -ve integer)
          !
          ! Out:
  
negative.code:                     end do
  
                  end do
                  
                  walker_population(1,idet) = tmp_pop
              
              end do
  
              ! now we advance all the spawned walkers to the barrier from their
  