public static int max(int depth, int alpha, int beta, ChessPiece[][] board) {
		if (depth == 0) return evaluate(board);
		
		System.out.println(root_depth);
		int max = Integer.MIN_VALUE;
		Set<ChessPiece> moves;
		ChessPiece selected;
		ChessPiece old_piece;
		ChessPiece to_be_moved = null;
		int score;
		int move_row = -1;
		int move_col = -1;
		
		
		
		for(int i = 0; i < 8; i++) {
			for(int j = 0; j < 8; j++) {
				selected = board[i][j];
				if(selected.color == Team.BLACK) {
					moves = selected.filterMoves(selected.getPossibleMoves(board), board);
					//System.out.println(board[i][j].type);
					for(ChessPiece p : moves) {
						//make move
						old_piece = board[p.row][p.col];
						board[p.row][p.col] = selected;
						board[i][j] = new ChessPiece(i,j);
						selected.row = p.row;
						selected.col = p.col;
						
						score = min(depth - 1, alpha, beta, board);
						
						if (score > alpha) {
							alpha = score;
							if(depth == root_depth) {
								to_be_moved = selected;
								move_row = p.row;
								move_col = p.col;
							}		
						}
						//unmake move
						board[p.row][p.col] = old_piece;
						board[i][j] = selected;
						selected.row = i;
						selected.col = j;
						
						System.out.println(board[i][j].type + " " + i + " " + j + " " + p.row + " " + p.col + " " + score);
						if(score >= beta)
							return score;
					}
				}
			}
		}
		if(depth == root_depth) {
			//System.out.println("making move");
			ChessBoard.move(to_be_moved, move_row, move_col);
		}
		return alpha;
	}