changed when buildtree is called in runAI