        (= (first (first p)) '?)
        (match4 (rest p) (rest s)))
       (do
-        (swap! variables (fn [vs] (assoc vs (first (rest (first p))) (first s))))
+        (swap! variables (fn [vs] (assoc vs (second (first p)) (first s))))
         true)
       :else false))
   (if (match-helper p s) @variables false))

       ((resolve (first (first p))) (first s))
       (match5 (rest p) (rest s)))
      (do
        (swap! variables (fn [vs] (assoc vs (first (rest (first p))) (first s))))
        true)
    :else false))
  (if (match-helper p s) @variables false))

       (= (first (first p)) '?)
       (match5 (rest p) (rest s)))
      (do
        (swap! variables (fn [vs] (assoc vs (second (first p)) (first s))))
        true)
      (and
       (= (count (first p)) 2)
