I think I figured out minimax (finally)