Changes to the minimax function