public short alphaBeta(AiNodeMaster node, int depth, int Max, short alpha, short beta){

		if (depth == 0) {
			return node.getNodeValue();
		}
		if (MaxNode(Max, node.getBoard())) {
			for (int i = 0; i < node.childNode.size(); i++) {
				alpha = max(alpha, alphaBeta(node.childNode.get(i), depth-1, Max, alpha, beta));
				if (alpha >= beta) {
					break;
				}				
			}	
			return alpha;
		}
		else{
			for (int i = 0; i < node.childNode.size(); i++) {
				beta = min(beta, alphaBeta(node.childNode.get(i), depth-1, Max, alpha, beta));	
				if (alpha >= beta) {
					break;
				}				
			}
			return beta;
		}	
	}