anchor.diff:        (setq res (discriminate-values (tree-node-right-child node) object-value topic-value feature-name))))
     res)
   
  -;; loops over the feature detectors (channels) of the agent
  -;; to try to discriminate the two objects in each of them
  -(defun discriminate-channels (channels topic object)
  -  "Discrimination attempt on all the given feature detectors (channels)"
  -  (loop for fd in channels do 
  -       (discriminate-values (sensory-channel-discrimination-tree fd) topic object (sensory-channel-feature-name fd))))
  +;; Gets the discrimination tree that belongs to a channel in the given list
  +;; corresponding with the given name
  +(defun get-node-channel-by-name (channels name)
  +  "Returns a discrimination tree for the channel with the given name
  +in the given list"
  +  (loop for c in channels do
  +       (when (String= name (sensory-channel-feature-name c))
  +         (return-from get-node-channel-by-name (sensory-channel-discrimination-tree c)))))
  +
  +;; List the channel names for a given list of channels
  +(defun get-channel-names (channels)
  +  "Returns the feature names for a given list of channels"
  +  (loop for c in channels
  +       collect (sensory-channel-feature-name c)))
   
   ;; Function in charge of making a discrimination between the objects of a scene
   ;; using the feature detectors (channels) of the agent
   (defun run-discrimination(channels scene)
     (let ((res '()))
       (loop for obj in (scene-objects scene) do
  -         (loop for gc in *game-channels* do
  -              (let ((disc (discriminate-channels channels (get-input-object-value (scene-topic scene) gc) (get-input-object-value obj gc))))
  +         (loop for gc in (get-channel-names channels) do
  +              (let ((disc (discriminate-values (get-node-channel-by-name channels gc) (get-input-object-value (scene-topic scene) gc) (get-input-object-value obj gc) gc)))
                   (when (not (eq disc nil))
                     (setq res (append res (list disc)))))))
       res))
   
  -;; Function in charge of 
  -(defun reward-discrimination-trees(trees)
  -  (let ((tr (nth (random (length trees) (make-random-state t)) trees)))
  +;; Given a list of discrimination results gives back their discrimination trees
  +(defun get-trees-from-discrimination-results(disc-results)
  +  "Returns the discrimination trees from a given list of discrimination results"
  +  (loop for dr in disc-results
  +       collect (discrimination-result-discrimination-node dr)))
  +
  +;; Function in charge of rewarding a successfull discrimination node
  +(defun reward-discrimination-trees(discrimination-results)
  +  (let* ( (trees (get-trees-from-discrimination-results discrimination-results)) (tr (nth (random (length trees) (make-random-state t)) trees)))
       (loop for tree in trees do
            (when(> (node-data-score (tree-node-data tree)) (node-data-score (tree-node-data tr)))
              (setq tr tree)))
  
positive.code: 
  (defun tree-pruning(tree)
    "Pruning depending on the age and score of the nodes"
    (let ((ls '()) (score (node-score tree)) (age (node-age tree)))
      (if(and (> age *pruning-min-age*) (< (/ score age) *pruning-treshold*))
         (progn 
           (setf (tree-node-left-child tree) nil)
           (setf (tree-node-right-child tree) nil))
         (when (and 
  
negative.code:          (setq channels (append channels (list (make-sensory-channel :feature-name c :discrimination-tree (get-root))))))
      channels))
  
  ;; List the values for a specific property in a set of input objects
  (defun get-property-values (objects feature-name)
    "List the values for a specific property in a set of input objects"
    (loop for o in objects
       collect (get-input-object-value o feature-name)))
  
  ;; Function to scale a list of input objects based on the scalable features
  (defun scale-objects (objects)
    "Scale the scalable features for the given list of objects"
    (loop for sf in *scalable-features* do
         (let ((max-feature-value (apply 'max (get-property-values objects sf))))
           (loop for o in objects do
                (set-input-object-value o (/ (get-input-object-value o sf) max-feature-value) sf))))
    objects)
  
  ;; Function to create a scene using the random objects. The topic is removed from the
  ;; list of objects in the scene to avoid redundant comparisons.
  (defun create-scene(&optional scale)
    "creates a scene for the game"
    (let* ((objs '()) (tpc nil) (scene nil))
      (if (not (eq scale nil))
          (setf objs (scale-objects (get-random-scene-objects)))
          (setf objs (get-random-scene-objects)))
      (setf tpc (nth (random *number-of-objects-per-scene* (make-random-state t)) objs))
      (setf scene (make-scene :objects (remove tpc objs) :topic tpc))
      scene
    ))
  
  ;; Gets the lower bound of a node, basic wrapper for slot accessor
  (defun get-lower-bound(node)
  