                            task-type irks henpt ancestry-path]
   (let [hem (get-htn-object (first ancestry-path))
         ;; DEBUG
-        ;; _ (println "  RPC0" plant-class "METHOD" method
-        ;;    "RPCHEM" (dissoc hem :subtasks :ancestry-path
-        ;;               :expansion-method :subtask-constraints))
-        ;; _ (if-not (htn-isa? task-type :htn-nonprimitive-task)
-        ;;     (println "  RPC HENPT" (dissoc henpt :subtasks :ancestry-path
-        ;;                              :expansion-method :subtask-constraints
-        ;;                              :task-expansions)))
+        _ (println "  RPC0" plant-class "METHOD" method
+           "\nRPCHEM" (dissoc hem :subtasks :ancestry-path
+                              :expansion-method :subtask-constraints)
+           "\nhem-pclass" hem-pclass
+           "pargs" pargs
+           "plant-class" plant-class
+           "task-type" task-type
+           "(:pclass henpt)" (:pclass henpt)
+           ;;"ancestry-path" ancestry-path
+           )
+        _ (if-not (htn-isa? task-type :htn-nonprimitive-task)
+            (println "  RPC HENPT" (dissoc henpt :subtasks :ancestry-path
+                                     :expansion-method :subtask-constraints
+                                     :task-expansions)))
         plant-class (if hem ;; avoid pathological case
                       (cond
                         (= plant-class ::unknown) ;; matching method in pargs?


;; vars -------------------------------------------------------

(def ^{:dynamic true} *debug-ir* (atom {}))

;; {pclass-name {method-name method}}
(def ^{:dynamic true} *htn-methods* (atom {}))

(defn reinitialize-htn-method-table []
  (reset! *htn-methods* {}))


;; will return subtasks, if any (and create htn-methods as a side effect)
;; irks are the ks to get-in the ir for the method in question (initially nil)
(defn make-htn-methods [ir pclass mname display-name margs body & [irks]]
  (let [irks (conj (or irks [pclass :methods mname]) :body)
        n (count body)]
    (loop [subtasks [] i 0]
