     {:train (subvec fitness-cases-shuffled 0 train-num)
      :test (subvec fitness-cases-shuffled train-num)}))
 
-;; Define the fitness cases. Do this once per run, so that train and test
-;; subsets stay the same throughout a run.
-(def bioavailability-fitness-cases (define-fitness-cases))
 
-;; Helper functions to get specific train and test cases
-;(defn train-fitness-case
-;  "Returns train fitness case number n for this run."
-;  [n]
-;  (nth (:train bioavailability-fitness-cases) n))
-;
-;(defn test-fitness-case
-;  "Returns test fitness case number n for this run."
-;  [n]
-;  (nth (:test bioavailability-fitness-cases) n))
-
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Define instructions and fitness cases
 
 ;; I want x0 through x240 to be instructions that, when executed, push
 ;; the float from that column onto the float stack.
 (doseq [[numb symb] (map #(vector % (symbol (str "x" %))) (range 241))]
   (eval `(define-registered ~symb (fn [state#] (push-item (stack-ref :auxiliary ~numb state#) :float state#)))))
-  
-;(sort (map str (vec @registered-instructions)))
 
+;; Define the fitness cases. Do this once per run, so that train and test
+;; subsets stay the same throughout a run.
+(def bioavailability-fitness-cases (define-fitness-cases))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Main functions to pass to pushgp
 
 ;; This definition of atom-generators makes it so that choosing a terminal
 ;; has equivalent probability of choosing one of the operators. This is

    (map #(map (fn [x] (float (read-string x)))
               %)
         lines)))

;(count (read-data))

;(count (first (read-data)))

;(map last (read-data))


(defn define-fitness-cases
  "Returns a map with two keys: train and test. Train maps to a

            (abs (- output top-float))
            10000.0)))))

(defn bioavailability-report
  "Customize generational report."
  [best population generation error-function report-simplifications]
  (let [best-program (not-lazy (:program best))
        best-test-errors (bioavailability-error-function :test best-program)] ;;not working
    (printf ";; -*- Bioavailability problem report generation %s" generation)(flush)
    (printf  "\nTest mean: %.4f"
            (float (/ (apply + best-test-errors)
                      (count best-test-errors))))(flush)
    (printf "\nTest RMSE: %.4f" (rmse best-test-errors))(flush)
    (printf "\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\n")(flush)
    ))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Main call

(pushgp
  :error-function (partial bioavailability-error-function :train)
