alphabeta and minimax functions cleaned