refactored minimax
refactored winner check