private double getCost(int nextLevelCalls, int[][] newBoard) {
        double cost = Double.NEGATIVE_INFINITY;
        if (nextLevelCalls == 0) {
            cost = evaluator.evaluate(newBoard);
        } else {
            for (int i = 0; i < newBoard.length; i++) {
                for (int j = 0; j < newBoard[i].length; j++) {
                    if (newBoard[i][j] == 0) {
                        newBoard[i][j] = 2;
                        cost = Math.max(cost, findBestMoveInternal(newBoard, nextLevelCalls).cost);
                        newBoard[i][j] = 4;
                        cost = Math.max(cost, findBestMoveInternal(newBoard, nextLevelCalls).cost);
                        newBoard[i][j] = 0;
                    }
                }
            }
        }
        return cost;
    }