                                           trivial-geography-radius)]
                         (dotimes [i population-size]
                           ((if use-single-thread swap! send)
-                           (nth child-agents i) 
-                           breed i (nth rand-gens i) pop error-function population-size max-points atom-generators 
-                           mutation-probability mutation-max-points crossover-probability 
-                           simplification-probability tournament-size reproduction-simplifications 
-                           trivial-geography-radius gaussian-mutation-probability 
-                           gaussian-mutation-per-number-mutation-probability gaussian-mutation-standard-deviation)))
+                               (nth child-agents i) 
+                               breed i (nth rand-gens i) pop error-function population-size max-points atom-generators 
+                               mutation-probability mutation-max-points crossover-probability 
+                               simplification-probability tournament-size reproduction-simplifications 
+                               trivial-geography-radius gaussian-mutation-probability 
+                               gaussian-mutation-per-number-mutation-probability gaussian-mutation-standard-deviation)))
                       (when-not use-single-thread (apply await child-agents)) ;; SYNCHRONIZE
                       (printf "\nInstalling next generation...") (flush)
                       (dotimes [i population-size]
                         ((if use-single-thread swap! send)
-                         (nth pop-agents i) (fn [av] (deref (nth child-agents i)))))
+                             (nth pop-agents i) (fn [av] (deref (nth child-agents i)))))
                       (when-not use-single-thread (apply await pop-agents)) ;; SYNCHRONIZE
                       (recur (inc generation)))))))))))
 

    [clojure.contrib.math :as math]
    [clojure.contrib.seq-utils :as seq-utils]
    [clojure.walk :as walk]
    [clojure.contrib.string :as string]))

(import java.lang.Math)


        (dorun (map #((if use-single-thread swap! send) % evaluate-individual error-function %2) pop-agents rand-gens))
        (when-not use-single-thread (apply await pop-agents)) ;; SYNCHRONIZE ; might this need a dorun?
        (printf "\nDone computing errors.") (flush)
        ;
        ;; some debugging code trying to track down nil agent results.... leaving in case not fixed
        ;(println (map :total-error (vec (doall (map deref pop-agents)))))(flush) ;***
        ;(loop [ers (map :total-error (vec (doall (map deref pop-agents))))] ;***
        ;  (when (some not ers) 
        ;    (println (map :total-error (vec (doall (map deref pop-agents)))))(flush) 
        ;    (recur (map :total-error (vec (doall (map deref pop-agents)))))))
        ;
        ;; report and check for success
        (let [best (report (vec (doall (map deref pop-agents))) generation error-function 
                           report-simplifications problem-specific-report)]
