start of minimax