       (if (= 1 (mod n 10000))
         (format-stats stats))
       (let [random-move (rand-nth valids)
-            result (simulate-step (perform-move state random-move))]
+            result (simulate-game (perform-move state random-move))]
         (recur (inc n)
                (-> stats
                    (update-in [random-move :n] inc)

      (update-in (concat (interleave (repeat :children) path) [:visited]) inc)
      (update-in (concat (interleave (repeat :children) path) [:score]) #(+ % result))))



(defn backprop [root path result]
  (if-not (empty? path)
    (recur (update-node root path result)

           :score 0
           :moves #{}
           :children {:move
                       {:visited 0 :score 0 :children {}}}})

(defn uct [node parent-visits]
  (+ (/ (:score node)
