         [clojush pushstate interpreter random util globals]
         clojush.instructions.tag)
   (:require [clojure.math.numeric-tower :as nt]))
+
+(define-registered
+  output_integer1
+  ^{:stack-types [:integer]}
+  (fn [state]
+    (if (empty? (:integer state))
+      state
+      (let [top-int (top-item :integer state)]
+        (stack-assoc top-int :output 0 state)))))
+
+(define-registered
+  output_integer2
+  ^{:stack-types [:integer]}
+  (fn [state]
+    (if (empty? (:integer state))
+      state
+      (let [top-int (top-item :integer state)]
+        (stack-assoc top-int :output 1 state)))))
 
 ; Atom generators
 (def atom-generators

   :problem-specific-initial-report initial-report
   :report-simplifications 0
   :final-report-simplifications 5000
   :max-error max-number-magnitude})

     (the-actual-error-function individual data-cases false))
    ([individual data-cases print-outputs]
      (let [behavior (atom '())
            errors (flatten
                    (doall
                     (for [[[input1 input2] [correct-output1 correct-output2]] (case data-cases
                                                                                 :train train-cases
                                                                                 :test test-cases
                                                                                 [])]
                       (let [final-state (run-push (:program individual)
                                                   (->> (make-push-state)
                                                        (push-item :no-output :output)
                                                        (push-item :no-output :output)
                                                        (push-item input2 :input)
                                                        (push-item input1 :input)))
                             result1 (stack-ref :output 0 final-state)
                             result2 (stack-ref :output 1 final-state)]
                         (when print-outputs
                           (println (format "Correct output: %s %s | Program output: %s %s"
                                            (str correct-output1) (str correct-output2)
                                            (str result1) (str result2))))
                         ; Record the behavior
                         (swap! behavior conj result1 result2)
                         ; Error is integer distance
                         (vector
                          (if (number? result1)
                            (nt/abs (- result1 correct-output1)) ;distance from correct integer
                            1000000) ;penalty for no return value
                          (if (number? result2)
                            (nt/abs (- result2 correct-output2)) ;distance from correct integer
                            1000000) ;penalty for no return value
                          )))))]
        (if (= data-cases :train)
          (assoc individual :behaviors @behavior :errors errors)
          (assoc individual :test-errors errors))))))
