modified turn variable to 0 or 1
new minimax function to combine Max() and Min()