     state))
 
 (defn- scale [state xy]
-  (map-indexed #(* %2 (/ (/ (window-size %1) 2)
-                         (get-in state [:grid-size %1]) )) xy))
+  (map-indexed #(* %2 (float (/ (window-half-size %1)
+                                (get-in state [:grid-size %1])))) xy))
 
 ; each bound is a position vector
 (defn- in-bounds? [min-bound max-bound pos]


(defn- ghost-incr [state]
  (assoc state :ghost
         (ghost/filter-active-nodes (ghost/incr (:ghost state) (:poss-fn state))
                                    #(let [[minb maxb] (quil-bounds state 2)]
                                       (in-bounds? minb maxb (:pos %1))))))



(defn update-state [state]
  (-> state
      (ghost-incr)
      (ghost-expire-roots)
      (update-in [:frame] inc)
      (maybe-exit)))

(defn- ellipse [state pos size] ; size is [w h]
