added a function to cut off a game tree at a certain level