         init  (env/initial-state e)
         root  (get-sa-node cache init (hierarchy/TopLevelAction e [(hierarchy/initial-plan henv)]))]
     (loop [cutoff 0 last-cutoff 0]
-;        (println "\ncutoff" cutoff "\n")
+        (println "\ncutoff" cutoff "\n")
       (let [result (expand-sa-node root cache cutoff init 0.0 0 (IdentityHashMap.) 0)]
         (cond (not (empty? (:result-map result)))
                 (let [[k v] (util/first-maximal-element val (:result-map result))]

              (util/assert-is (<=  (+ b-rts (:cutoff rec)) (- neg-reward)) "%s %s %s" neg-reward b-rts (cutoff (:queue b-sa)))
              (reset! (:rec-context-atom entry) (:rec-context rec))
              (doseq [n good-nodes]      
                (assert (<= (:reward-to-state n) (min init-cutoff (- neg-reward))))
                (queues/g-pq-add! good-queue n (- (:reward-to-state n))))
              (doseq [n (concat nbn sbn)] 
                (queues/g-pq-add! bad-queue  n (- (:reward-to-state n))))

                 clean)

;          (println (apply str (repeat depth \ )) (count clean) (count dirtied) (count still-dirty))
          (when (= (first (env/action-name (:action node))) 'nav)
            (let [[_ dx dy] (env/action-name (:action node))]
              (doseq [[ss sr] (stitch-effect-map clean state 0 #_ reward-to-state)]
                (println ss sr clean new-results (env/action-name (:action node)))
                (let [[sx sy] (map #(env/get-var state %) '[[atx] [aty]])]
                  (when-not (= (- sr) (+ (util/abs (- sx dx)) (util/abs (- sy dy))))
                     (println "ERROR" [sx sy] [dx dy] sr (:min-cycle-depth (:entry (meta ss))) reward-to-state) #_ (dr/debug-repl))))))
          
          (doseq [entry (concat good-roots (map #(:entry (meta (key %))) dirtied))] 
            (assert (util/xor (not (:sanode entry)) (:cutoff (meta entry))))
