                (-> cur
                    (datalog/assert-many feed-set)
                    (datalog/and-now)
-                   (tick (:rules @env) (:watchers @env) (:feeder-fn @env))
+                   (tick (:tick-rules @env) (:rules @env) (:watchers @env) (:feeder-fn @env))
                    (datalog/retract-many feed-set)
                    (datalog/and-now))))
       (.timeEnd js/console "run")

    (handle-feed env)
    env))

(defn make-env
  ([kn rules]
   (make-env kn rules @watchers))
  ([kn rules watchers]
   (atom {:kn (datalog/Knowledge. kn #{} #{})
          :rules rules
          :watchers watchers
          :feed (array)
          :queued? false})))

(defn pause [env]
  (swap! env assoc :paused true))

  (datalog/chain (for [stratum strata]
                   (datalog/fixpoint (datalog/chain stratum)))))

(defn tick [kn tick-rules rules watchers feeder-fn]
  (let [chained-tick-rules (datalog/chain tick-rules)
        kn (chained-tick-rules kn)
        chained (chain-rules rules)
        kn (chained kn)]
    (doseq [watch watchers]
      (watch kn feeder-fn))
    (datalog/and-now kn)))

