public LineScore alphabeta_max(int currentDepth, int alpha, int beta, Tuple lastMove) {
	    if (currentDepth >= depth || board.legalMoves.isEmpty()) {
	    	System.out.println("Board state before eval return:\n" + board);
	    	int eval = board.eval(weights);
	    	evals++;
	    	System.out.println("Returning eval: " + eval + " at max.");
	    	if (eval < -1000000 || eval > 1000000)
	    		System.out.println("WIN DETECTED FOR MIN!");
	    	return new LineScore("", eval);
	    }
	    Tuple bestMove=null;
	    String lineTrace=null;
	    LineScore lS=null;
	    int a = infHolder.MIN - 1;
	    LinkedList<Tuple> list = (LinkedList<Tuple>) board.legalMoves.clone();
	    for (Tuple chosenMove : list) {
	        board.move(chosenMove);
	    	System.out.println("Now searching move " + chosenMove + ", a=" + alpha + ", b=" + beta + " max");
	        lS = alphabeta_min(currentDepth+1, alpha, beta, chosenMove.clone());
	        if (a < lS.score) {
	    		bestMove = chosenMove;
	    		lineTrace = lS.line;
	        }
	        a = max(a, lS.score);
	        if (a >= beta) {
	        	System.out.println("Move " + chosenMove + " better than beta of " + beta + " (" + a + ")");
		        MoveRecord oldMove = board.takeBack(1);
		        System.out.println("Took back " + oldMove.move + " at depth " + currentDepth);
	        	return new LineScore(chosenMove + ", " + lS.line, beta);
	        }
	        if (a > alpha) {
	        	System.out.println("Move " + chosenMove + " sets alpha to " + a + " (alpha was " + alpha + ")");
	        	alpha = a;
	        }
	        MoveRecord oldMove = board.takeBack(1);
	        System.out.println("Took back " + oldMove.move + " at depth " + currentDepth);
	    }
	    return new LineScore(bestMove + ", " + lineTrace, a);
	}