private Result minimax(GomokuGameNode node, int depth, int alpha, int beta, boolean needMax) {
		if (depth <= 0 || node.isTerminalNode()) {
			Result result = new Result();
			int score = node.getObjectiveValue(computerPiece);
			result.setScore(score);
			return result;
		}

		Result best = new Result();
		
		for (GomokuGameNode child : node.getChildren()) {
			Result result2 = minimax(child, depth-1, alpha, beta, !needMax);
			
			int score = result2.getScore();
			numComparisons++;
			if (needMax) {  // Do Max
				if (score > alpha) {
					alpha = score;
					best = new Result();
					best.add(child);
					best.addAll(result2.gameNodes);
				}
				if (beta <= alpha) {
					break;
				}
			} else { // Do Min
				if (score < beta) {
					
					best = new Result();
					best.add(child);
					best.addAll(result2.gameNodes);
					
					beta = score;
				}
				if (beta <= alpha) {
					break;
				}
			}
		}
		int retval = needMax ? alpha : beta;		
		best.setScore(retval);
		return best;
	}