public Problem(DataBean newDB) {
        startTime = System.currentTimeMillis();

        switch (newDB.alg) {//determine algorithm to run
            case 1:
                reachedGoal = DepthFirstSearch(newDB.initState);
                break;
            case 2:
                reachedGoal = BreadthFirstSearch(newDB.initState);
                break;
            case 3:
                reachedGoal = UniformCostSearch(newDB.initState);
                break;
            case 4:
                reachedGoal = GreedyBestFirstSearch(newDB.initState);
                break;
            case 5:
                reachedGoal = ASearch(newDB.initState);
                break;
        }

        algTime = System.currentTimeMillis() - startTime;

        switch (newDB.outputLev) {//determine output level
            case 1:
                p.printDistance(reachedGoal);
                break;
            case 2:
                p.printActions(reachedGoal, -1);
                break;
            case 3:
                p.printStateSequence(reachedGoal);
                break;
        }

        totalTime = System.currentTimeMillis() - startTime;

        System.out.printf("Time to run algorithm: " + algTime + " milliseconds\n");
        System.out.printf("Time to execute Free Cell Solver: " + totalTime + " milliseconds\n");
    }