 
 (defn unit? [kind coords]
   (first (filter
-          #(= coords %)
+          #(= coords (:coords %))
           (kind (:cells (om/root-cursor app-state))))))
 
 (defn highlight-tile [e]

(defonce app-state (atom
                    {:cells
                        {:blue-team
                         [{:x 0, :y 0}
                          {:x 2, :y 0}
                          {:x 4, :y 0}
                          {:x 6, :y 0}
                          {:x 8, :y 0}]
                        :red-team
                         [{:x 0, :y 8}
                          {:x 2, :y 8}
                          {:x 4, :y 8}
                          {:x 6, :y 8}
                          {:x 8, :y 8}]
                        :balls
                         [{:x 0, :y 4}
                          {:x 2, :y 4}
                          {:x 4, :y 4}
                          {:x 6, :y 4}
                          {:x 8, :y 4}]}}))

(def board-size (range 0 9))
(def bench-size 4)

              (om/transact! app [:cells :red-team]
                (fn [units]
                  (map
                   #(if (and
                         (= selected (:coords %))
                         (<= (reduce + (map (fn [a b] (Math/abs (- b a))) (vals target) (vals selected))) (:distance %)))
                      (conj % {:coords target})
                      %)
                   units)))))
          (recur)))))

