before minimax, still have to do some refactor