    :dfs '()})
 
 ;;;
+;;; util
+;;;
+
+(defn rand-bi-dir
+  "get a random value between -n and n"
+  [n]
+  (q/random (- n) n))
+
+(defn map-value
+  "iterates through map and applies fn to values returning new map"
+  [fn m]
+  (into {} (for [[key value] m] [key (fn value)])))
+
+;;;
 ;;; graph elements and operations
 ;;;
 
-(defn node 
-  "Construct a node record"
-  [label ; used for referencing the node in the graph's map
-   pos ; {:x __ :y __}
-   color-key ; color key used by the x-first-search and as the key for physically coloring the node
-   size ; float
-   vel ; velocity {:x __ :y __ :s __} where s is size-change velocity
-   siblings] ; set of labels of directly connected nodes
-
-  {:label label :pos pos :color-key color-key :size size :vel vel :siblings siblings})
+(defn create-random-node
+  "Construct a random node record
+   label used for referencing the node in the graph's map"
+  [label]
+  {:label label
+   :pos {:x (rand-int (q/width))
+         :y (rand-int (q/height))}
+   ; color key used by the x-first-search and as the key for physically coloring the node
+   :color-key :untouched
+   :size (+ size-min (rand-int (- size-max size-min)))
+   :vel {:x (rand-bi-dir directional-speed-max)
+         :y (rand-bi-dir directional-speed-max)
+         :s (rand-bi-dir size-acceleration)}
+   :siblings '()})
 
 (defn add-edge
   "add an edge (set with two elements - the label of each node) to a node-map (map node-label->node)."
   [nodes edge]
-  (let [edge (into '() edge) ; cannot index/peek set, so use list
-        n1-key (peek edge)
-        n2-key (peek (pop edge))
-        ;; each node has the other node as a sibling
-        nodes (update-in nodes [n1-key :siblings] (fn [s] (conj s n2-key)))
-        nodes (update-in nodes [n2-key :siblings] (fn [s] (conj s n1-key)))]
-    nodes))
+  (let [[n1-label n2-label] edge]
+    (-> nodes
+        (update-in [n1-label :siblings] conj n2-label)
+        (update-in [n2-label :siblings] conj n1-label))))
 
 (defn extract-edges
   "get a set of edges given a node-map"
   [nodes]
-  ;; reduce edge sets from each node into a single set
-  (reduce 
-    (fn [edges n]
-      (sets/union edges 
-                  ;; create set of edges from a given node
-                  (reduce 
-                    (fn [edges k]
-                      (conj edges #{(:label n) k}))
-                    #{}
-                    (:siblings n))))
-    #{}
-    nodes))
-
-;;;
-;;; util
-;;;
-
-(defn rand-bi-dir
-  "get a random value between -n and n"
-  [n]
-  (- (rand (* 2 n)) n))
+  (set (for [node nodes
+             sibling-label (:siblings node)]
+         #{(:label node) sibling-label})))
+
 
 ;;;
 ;;; quil state manipulation and drawing

(defn adjust-directional-vel-to-bounds
  "adjust velocity if it is too fast or goes outside of view area"
  [vel pos max-speed min-pos max-pos bounce-vel size]
  (cond 
    (> (+ pos vel (/ size 2)) max-pos)
    (- 0 bounce-vel)


            y-delta (- y2 y1)
            theta (q/atan2 x-delta y-delta)
            theta-2 (- (q/radians 90) theta)
            x-delta-2 (q/sin theta-2)
            y-delta-2 (q/cos theta-2)
            x1-a (+ x1 (* size1-adj x-delta-2))
            x1-b (- x1 (* size1-adj x-delta-2))
