            :let [bindings (activation fact)] :when bindings]
        (->Element fact bindings)))))
 
+;; Record for the join node, a type of beta node in the rete network. This node performs joins
+;; between left and right activations, creating new tokens when joins match and sending them to 
+;; its descendents.
 (defrecord JoinNode [condition children binding-keys]
   ILeftActivate
   (left-activate [node join-bindings tokens memory transport] 

    (retract-tokens transport memory (:children node) 
                    [(->Token new-facts new-bindings)])))

(defn- send-accumulated [node accumulator token result fact-bindings transport memory]
  (let [converted-result ((get-in accumulator [:definition :convert-return-fn]) result)
        new-bindings (merge (:bindings token) 
                            fact-bindings

    (remove-elements! memory node elements join-bindings) ;; FIXME: elements must be zero to retract.
    (send-tokens transport memory children (get-tokens memory node join-bindings))))

;; The test node represents a Rete extension in which 
(defrecord TestNode [test children]
  ILeftActivate
  (left-activate [node join-bindings tokens memory transport] 
