                          (= (get-type lexpr) [:int])
                          (= (get-type rexpr) [:int]))
                      (util/succ [vars2 (with-type [:erel lexpr op rexpr] [:bool])])
-                     (util/err (str "expr invalid; expected int,int, found " (print-type (get-type lexpr)) ", " (print-type (get-type rexpr)) " in: " location))
+                     (if (and
+                           (= (get-type lexpr) [:bool])
+                           (= (get-type rexpr) [:bool])
+                           (or
+                             (= (third expr) [:eq])
+                             (= (third expr) [:ieq])
+                             )
+                           )
+                       (util/succ [vars2 (with-type [:erel lexpr op rexpr] [:bool])])
+                       (util/err (str "expr invalid; expected int,int or bool,bool, found " (print-type (get-type lexpr)) ", " (print-type (get-type rexpr)) " in: " location)))
                      )
                ]
               res)

                                         ) (m-result [(new-scope vars) [:block]]) (rest code))]
               [(rm-scope avars) result]
               )
      :vret (check-types (util/succ [:void]) (lookup-var vars "_return_" location) [vars [:vret]] location)
      :ret (m/domonad util/phase-m
             [[nvars expr] (annotate-expr glob-state vars (second code))
              [type _] (lookup-var nvars "_return_" location)
              res (check-types (m-result type) (m-result (get-type expr)) [nvars (with-type [:ret expr] (get-type expr))] location)
              ]
             res)
      :incr (m/domonad util/phase-m
              [[type num] (lookup-var vars (second code) location)
               res (check-types (util/succ [:int]) (m-result type) [vars (with-type [:incr [:ident num]] [:int])] location)]
              res)
      :decr (m/domonad util/phase-m
              [[type num] (lookup-var vars (second code) location)
               res (check-types (util/succ [:int]) (m-result type) [vars (with-type [:decr [:ident num]] [:int])] location)]
              res)
      :decl (m/domonad util/phase-m
              [type (m-result (second code))

             [name (m-result (second code))
              [nvars expr] (annotate-expr glob-state vars (third code))
              [type num] (lookup-var vars name location)
              res (check-types type (get-type expr) [nvars (with-type [:ass [:ident num] expr] (get-type expr))] location)]
             res)
      :cond (m/domonad util/phase-m
              [
               [vars1 expr] (annotate-expr glob-state vars (second code))
               [vars2 nblock] (annotate-code glob-state vars1 (third code))
               res (check-types [:bool] (get-type expr) [vars2 [:cond expr nblock]] location)]
              res)
      :condelse (m/domonad util/phase-m
                  [
                   [vars1 expr] (annotate-expr glob-state vars (second code))
                   [vars2 nblock1] (annotate-code glob-state vars1 (third code))
                   [vars3 nblock2] (annotate-code glob-state vars2 (fourth code))
                   res (check-types [:bool] (get-type expr) [vars3 [:condelse expr nblock1 nblock2]] location)]
                  res)
      :while (m/domonad util/phase-m
               [
                [vars1 expr] (annotate-expr glob-state vars (second code))
                [vars2 nblock] (annotate-code glob-state vars1 (third code))
                res (check-types [:bool] (get-type expr) [vars2 [:while expr nblock]] location)]
               res
               )
      :sexp (m/domonad util/phase-m
