 (def particle-diameter (* 2 particle-radius))
 (def particle-count 10)
 (def gravitational-constant 200)
-(def speed-limit 5)
 (def initial-speed 0)
+(def bounciness 0.4)
 
 (def scene-width window/innerWidth)
 (def scene-height window/innerHeight)
 
 (def particles (atom []))
 (def particle-meshes (atom []))
-(def collided-particles (atom {}))
 
 (def nullv [0 0 0])
 

       particles

       ;; if there are collisions, calculate the appropriate adjustments to
       ;; position and velocity, and assoc the updated particles back into the
       ;; particles vector.
       (apply
        (partial assoc particles)
        (flatten
         (for [[a pa b pb] collisions
               :let [dir (direction-from (:pos pa) (:pos pb))
                     dist (distance (:pos pa) (:pos pb))
                     bounce (direction dir (- particle-diameter dist))]]
           [a (assoc pa
                :pos (map - (:pos pa) bounce)
                :vel (map -
                          (:vel pa)
                          (direction dir (magnitude (:vel pa)))))
            b (assoc pb
                :pos (map + (:pos pb) bounce)
                :vel (map +
                          (:vel pb)
                          (direction dir (magnitude (:vel pb)))))]))))))

(defn generate-particles
  "Creates the given number of particles, and arranges them in the universe

       (if (zero? mag)
         nullv
         (map #(* (/ % mag) m) v)))))

(defn project
  "Calculates the vector projection of a in the direction of b."
  [a b]
  (let [scalar (apply + (map * a (direction b)))]
    (direction b scalar)))

(defn direction-from
  "Given two vectors, returns a unit vector representing the direction from the
