         w [{:gen-id gen-id
             :event-ch event-ch}]
         root-actx (atom nil)
-        vis (atom {:actxs {} ; {actx -> {:children {}, :wait-chs {}}}.
-                   :chs {}   ; {ch -> {:id (gen-id), :msgs {}}}.
+        vis (atom {:actxs {} ; {actx -> {:children {child-actx -> true},
+                             ;           :wait-chs {ch -> (:take|:put)}}}.
+                   :chs {}   ; {ch -> {:id (gen-id),
+                             ;         :msgs {msg -> true}}}.
                    :gen-id gen-id})]
     (go-loop [num-events 0]
       (let [tdv @event-delay]

   {:beg (fn [vis actx args]
           (let [[ch msg] args]
             (swap! vis #(assoc-in % [:actxs actx :wait-chs ch] :put))
             (swap! vis #(update-in % [:chs ch]
                                    (fn [v]
                                      (if (nil? v)
                                        {:id ((:gen-id @vis)) :msgs {msg true}}
                                        (assoc-in v [:msgs msg] true)))))))
    :end (fn [vis actx args]
           (let [[ch msg result] args]
             (swap! vis #(dissoc-in % [:actxs actx :wait-chs ch]))))}

   {:beg (fn [vis actx args]
           (let [[ch] args]
             (swap! vis #(assoc-in % [:actxs actx :wait-chs ch] :take))
             (vis-add-ch vis ch)))
    :end (fn [vis actx args]
           (let [[ch result] args]
             (swap! vis #(dissoc-in % [:actxs actx :wait-chs ch]))))}
