 
 (defn moving-inc-c [vbl width limit]
   [:and
-   [:lt vbl (- limit width)]
-   [:geq vbl (list '- limit width [:d vbl])]])
+   [:lt vbl limit]
+   [:geq vbl (list '- limit width)]])
 
 (defn moving-dec-c [vbl limit]
   [:and
-   [:gt vbl limit]
-   [:leq vbl (list '- limit [:d vbl])]])
+   [:gt vbl (list '- limit 16)]
+   [:leq vbl limit]])
 
 (defn moving-inc [vbl width other-ha]
   [:and
-   [:lt vbl [other-ha vbl] (- width)]
-   [:geq vbl [other-ha vbl] (list '- [:d other-ha vbl] [:d vbl] width)]])
+   [:lt vbl [other-ha vbl] (+ (- width) 16)]
+   [:geq vbl [other-ha vbl] (- width)]])
 
 (defn moving-dec [vbl width other-ha]
   [:and
-   [:gt vbl [other-ha vbl] width]
-   [:leq vbl [other-ha vbl] (list '+ [:d other-ha vbl] width (list '- [:d vbl]))]])
+   ; vbl > o.vbl
+   ; vbl - o.vbl > 0
+   [:gt vbl [other-ha vbl] 0]
+   ; vbl <= o.vbl + ow
+   ; vbl - o.vbl <= ow
+   [:leq vbl [other-ha vbl] width]])
 
 (defn between-c [vbl min max]
   [:and
-   ; vbl+dvbl >= min --> vbl >= min - dvbl
-   [:geq vbl (list '- min [:d vbl])]
-   ; vbl+dvbl < max --> vbl < max - dvbl
-   [:lt vbl (list '- max [:d vbl])]])
+   ; vbl >= min --> vbl >= min
+   [:gt vbl min]
+   ; vbl <= max --> vbl <= max
+   [:lt vbl max]])
 
 (defn between [vbl dim other-ha other-dim]
-  ; vbl+dvbl >= other-ha.vbl + other-ha.dvbl - dim && vbl+dvbl < other-ha.vbl+other-ha.dvbl + other-dim
-  ; vbl - other-ha.vbl >= other-ha.dvbl - dvbl - dim && vbl - other-ha.vbl < other-ha.dvbl + other-dim - dvbl
+  ; vbl  >= other-ha.vbl - dim && vbl < other-ha.vbl + other-dim
+  ; vbl - other-ha.vbl >= - dim && vbl - other-ha.vbl < other-dim
   [:and
-   [:geq vbl [other-ha vbl] (list '- [:d other-ha vbl] [:d vbl] dim)]
-   [:lt vbl [other-ha vbl] (list '+ [:d other-ha vbl] other-dim (list '- [:d vbl]))]])
+   [:gt vbl [other-ha vbl] (list '- dim)]
+   [:lt vbl [other-ha vbl] other-dim]])
 
 (defn bumping-guard [dir other]
   (let [main-vbl (case dir (:left :right) :x (:top :bottom) :y)

                                     [160 8 8 16]
                                     ;todo: a "waterfall staircase" for goomba fall testing.
                                     }
                             objects [(goomba :ga x 8 16 :right ids walls)
                                      (goomba :gb (+ x 18) 8 16 :left ids walls)
                                      (goomba :gc (+ x 38) 8 16 :right ids walls)
                                      (goomba :gd (+ x 58) 8 16 :left ids walls)
                                      (goomba :ge (+ x 88) 32 16 :right ids walls)
                                      ; TODO: goomba falling off of platforms. add a "staircase" to the right.

  (let [rel (first simple-guard)
        c (constant-from-expr has ha (last simple-guard))
        ;_ (println "Constant" (last simple-guard) "is" c)
        v1k (second simple-guard)
        v2k (if (= (count simple-guard) 4) (third simple-guard) nil)
        [v10 v1f] (get-var-and-flow has ha v1k)
