Wrote (most of) MCTS class