     {:boids     boids
      :obstacles [
                  {:position (multiply (Vector. (q/width) (q/height)) 0.5)
-                  :radius 50}]})
+                  :radius 50}]
+     :flock? true})
 
   )
 
-(defn update-boid [b bs os]
+(defn update-boid [b flock? bs os]
   ;(.profile js/console "update")
   (let [requested []
         nearby-boids (filter (partial not= b) (filter #(< (dist (:position b) (:position %)) 100) bs))
 
         ;; Avoid walls
 
-        requested (conj requested (multiply (Vector. -1 0) (/ 100 (q/sq (- (q/width) (:x (:position b)))))))
-        requested (conj requested (multiply (Vector. 1 0) (/ 100 (q/sq (:x (:position b))))))
-        requested (conj requested (multiply (Vector. 0 1) (/ 100 (q/sq (:y (:position b))))))
-        requested (conj requested (multiply (Vector. 0 -1) (/ 100 (q/sq (- (q/height) (:y (:position b)))))))
+        requested (conj requested (multiply (Vector. -1 0) (/ 500 (q/sq (- (q/width) (:x (:position b)))))))
+        requested (conj requested (multiply (Vector. 1 0) (/ 500 (q/sq (:x (:position b))))))
+        requested (conj requested (multiply (Vector. 0 1) (/ 500 (q/sq (:y (:position b))))))
+        requested (conj requested (multiply (Vector. 0 -1) (/ 500 (q/sq (- (q/height) (:y (:position b)))))))
 
         ;; Avoid obstacles
 


(defn update-boids [state]
  (assoc state :boids (map (fn [b]
                             (update-boid b (:boids state) (:obstacles state))) (:boids state) )))

(defn draw [state]
  (q/background 200)

    :update #'update-boids
    :middleware [m/fun-mode]
    :draw #'draw
    :size [(- (aget js/window "innerWidth") 40) (- (aget js/window "innerHeight") 100)]
    :mouse-moved mouse-moved
    :mouse-clicked mouse-clicked))

(boids-sketch)
