                   (vec (for [case-history (apply map list (:history ind))]
                          (let [improvements (mapv (fn [[newer-error older-error]]
                                                     (if (< newer-error older-error)
+                                                      1.0
+                                                      (if (= newer-error older-error) 
+                                                        -1.0
+                                                        0.0)))
+                                                  (partition 2 1 case-history))
+                               weights (take (count improvements)
+                                             (iterate (partial * (- 1 improvement-discount)) 1))
+                               sum (reduce + (mapv * improvements weights))]
+                           (- sum))))))
+              #_(if (not (:print-history argmap))
+                (throw
+                  (Exception.
+                    ":print-history must be true for :case-stagnation"))
+                (if (empty? (rest (:history ind)))
+                  (vec (repeat (count (:errors ind)) 1000000))
+                  (vec (for [case-history (apply map list (:history ind))]
+                         (let [improvements (mapv (fn [[newer-error older-error]]
+                                                    (if (or (zero? newer-error)
+                                                            (< newer-error older-error))
                                                       1.0
                                                       (if (= newer-error older-error) 
                                                         -1.0

                                               (iterate (partial * (- 1 improvement-discount)) 1))
                                 sum (reduce + (mapv * improvements weights))]
                             (- sum)))))))
              #_(if (not (:print-history argmap))
                (throw
                  (Exception.
                    ":print-history must be true for :case-stagnation"))

                                               (iterate (partial * (- 1 improvement-discount)) 1))
                                 sum (reduce + (mapv * improvements weights))]
                             (- sum)))))))
              #_(if (not (:print-history argmap))
                (throw
                  (Exception.
                    ":print-history must be true for :case-stagnation"))
