 
         ;; Match velocity with nearby boids
 
-        requested (if (> (count nearby-boids) 0)
+        requested (if (and flock? (> (count nearby-boids) 0))
                     (conj requested (multiply (subtract (multiply (reduce add (map :velocity nearby-boids)) (/ 1 (count nearby-boids))) (:velocity b))
                                               0.1))
                     requested)
         ;; Attract to Center of Mass of nearby boids
 
 
-        requested (if (> (count nearby-boids) 0)
+        requested (if (and flock? (> (count nearby-boids) 0))
                     (let [com (multiply (reduce add (map :position nearby-boids)) (/ 1 (count nearby-boids)))]
                       (conj requested (normalise (subtract com (:position b)))))
                     requested)

    :update #'update-boids
    :middleware [m/fun-mode]
    :draw #'draw
    :size [1000 800]
    :mouse-moved mouse-moved))

(boids-sketch)

(ns boids.core
  (:require [quil.core :as q :include-macros true]
            [quil.middleware :as m :include-macros true]))

(defprotocol PVec
  (add [a b])
