fixing minimax bug