Hopefully working minimax