         (let [[o1 p1] op1
               p1' (if (string? p1) (count p1) p1)
               [o2 p2] op2]
-          (condp = (compare p1' p2)
+          (case (compare p1' p2)
             -1
             (recur (rest edit1) (cons [o2 (- p2 p1')] (rest edit2))
                    (conj out [op1 [o2 p1']]))


(defn count-op
  [[o p]]
  (match [o]
    [:=] p
    [:-] p 
    [:+] (count p)))

(defn count-before
  [edit]
  (reduce
    (fn [c op]
      (match [op]
        [[:= p]] (+ c p)
        [[:- p]] (+ c p)
        [[:+ p]] c))
    0 edit))

(defn count-after
  [edit]
  (reduce
    (fn [c op]
      (match [op]
        [[:= p]] (+ c p)
        [[:- p]] c
        [[:+ p]] (+ c (count p))))
    0 edit))

(defn apply-edit

        :else
        (let [[o1 p1] op1
              [o2 p2] op2]
          (case (compare p1 p2)
            -1 (recur (rest edit1)
                      (cons [o2 (- p2 p1)] (rest edit2))
                      (conj out [op1 [o2 p1]]))
