     (assoc state
         :hinges
             (let
-                [[q w i o a s k l] (map (:keys input-state) [
-                    KeyCodes/Q KeyCodes/W KeyCodes/I KeyCodes/O
-                    KeyCodes/A KeyCodes/S KeyCodes/K KeyCodes/L
+                [[fca fcb fka fkb rca rcb rka rkb] (map (:keys input-state) [
+                    KeyCodes/I KeyCodes/O KeyCodes/K KeyCodes/L
+                    KeyCodes/Q KeyCodes/W KeyCodes/A KeyCodes/S
                     ])]
                 (map (fn [h] (let [hn (hinge-nodes h)]
                     (assoc h :modifier-angle
                         (clamp (+ (:modifier-angle h)
                             (cond
                                 (= hn [:tail :head :h-l-k])
-                                    (+ (if q 0.05 0.0) (if w -0.05 0.0))
+                                    (+ (if fca 0.05 0.0) (if fcb -0.05 0.0))
                                 (= hn [:head :h-l-k :h-l-f])
-                                    (+ (if i 0.05 0.0) (if o -0.05 0.0))
+                                    (+ (if fka 0.05 0.0) (if fkb -0.05 0.0))
                                 (= hn [:tail :head :h-t-k])
-                                    (+ (if q -0.05 0.0) (if w 0.05 0.0))
+                                    (+ (if fca -0.05 0.0) (if fcb 0.05 0.0))
                                 (= hn [:head :h-t-k :h-t-f])
-                                    (+ (if i -0.05 0.0) (if o 0.05 0.0))
+                                    (+ (if fka -0.05 0.0) (if fkb 0.05 0.0))
                                 (= hn [:head :tail :t-l-k])
-                                    (+ (if a 0.05 0.0) (if s -0.05 0.0))
+                                    (+ (if rca 0.05 0.0) (if rcb -0.05 0.0))
                                 (= hn [:tail :t-l-k :t-l-f])
-                                    (+ (if k 0.05 0.0) (if l -0.05 0.0))
+                                    (+ (if rka 0.05 0.0) (if rkb -0.05 0.0))
                                 (= hn [:head :tail :t-t-k])
-                                    (+ (if a -0.05 0.0) (if s 0.05 0.0))
+                                    (+ (if rca -0.05 0.0) (if rcb 0.05 0.0))
                                 (= hn [:tail :t-t-k :t-t-f])
-                                    (+ (if k -0.05 0.0) (if l 0.05 0.0))
+                                    (+ (if rka -0.05 0.0) (if rkb 0.05 0.0))
                                 :else
                                     0.0))
                             (:min-modifier-angle h) (:max-modifier-angle h)))))

            hinges)))

(defn calculate-gravity-forces [nodes]
    (zipmap (keys nodes) (repeat [0 (- gravity-strength)])))

(defn calculate-ground-forces [nodes]
    (zipmap (keys nodes)
        (map (fn [{[ x y ] :pos [ xv yv ] :vel }]
            (if (< y 0)
                (vec* [(- xv) (+ (Math/max 0 (- yv)) (- y))] ground-strength)
                [0 0])) (vals nodes))))

(defn calculate-all-node-forces [{:keys [nodes springs hinges]}]
    (merge-with vec+
        (calculate-spring-forces nodes springs)
        (calculate-hinge-forces nodes hinges)
        (calculate-gravity-forces nodes)
        (calculate-ground-forces nodes)))

(defn update-node-velocities [nodes forces time-step]
    (merge-with (fn [n f]
        (assoc n
            :vel (vec+ (:vel n) (vec* f time-step))))
        nodes
        forces))


(defn rot-cw [[x y]] [y (- x)])
(defn rot-ccw [[x y]] [(- y) x])

(defn make-node [x y m] {:pos [x y] :vel [0 0] :mass m})
(defn make-spring [a b] {:node-a a :node-b b})
(defn make-hinge [a b c min-a max-a] {:node-a a :node-b b :node-c c :min-modifier-angle min-a :max-modifier-angle max-a})
(defn make-state [nodes springs hinges] {
