updating with working minimax.