private void calculate() {
        int termLength, payFreq;

        loanScheduleTableModel.setRowCount(0);

        // set PDL paydown amount
        try {
            String aprStr = aprTextField.getText();
            calculator.setInstallAPR(Double.parseDouble(aprStr));
        } catch (NullPointerException npe) {
            String msg = "Please enter a number for the APR";
            printErrorMsg(npe, msg);
            return;
        } catch (NumberFormatException nfe) {
            String msg = "Invalid Number: Please enter a valid number for the APR";
            printErrorMsg(nfe, msg);
            return;
        }

        payFreq = calculator.getInstallPayFreq();

        if (payFreq == PayFrequency.MONTHLY.getLoanPeriod()) {
            termLength = calculator.getTermLength();
        } else {
            termLength = calculator.getTermLength() * 2; // set for all but monthly
        }

        // calculate the totalPayments payment amount per period
        calculator.calculateInstallPmt();

        // payday loan payoff amount
        // -----------------------------
        ArrayList<Double> pdlPmts = new ArrayList<Double>();
        pdlPmts = calculator.calculatePdlPayoffAmt();

        int row = 0;
        double principal = (double) calculator.getInstallPrincipal();
        double totalPayments = 0, payment = 0;
        double totalIntPayments = 0, intPayment;
        double totalPrinPayments = 0, prinPayment;
        double balance = principal;
        double payOffAmt;
        while (row < termLength) {
            loanScheduleTableModel.addRow(new Object[][]{null, null, null, null, null, null});

            // set total payment, interest, princpal amounts
            nf.setMaximumFractionDigits(2);
            payment = calculator.getInstallPaymentAmt() * -1;
            intPayment = calculator.calculateInstallIntPmt(row + 1) * -1;
            prinPayment = payment - intPayment;

            // running totals
            totalPrinPayments += prinPayment;
            totalIntPayments += intPayment;
            totalPayments += payment;
            balance -= prinPayment;
            payOffAmt = (payment * (row + 1)) + balance;

            //loanScheduleTable.setValueAt(df.format(dueDate), row, 0);
            loanScheduleTable.setValueAt(row + 1, row, 0);
            loanScheduleTable.setValueAt("$" + nf.format(payment), row, 1);
            loanScheduleTable.setValueAt("$" + nf.format(prinPayment), row, 2);
            loanScheduleTable.setValueAt("$" + nf.format(intPayment), row, 3);
            loanScheduleTable.setValueAt("$" + nf.format(payOffAmt), row, 4);

            ++row;
        }
        // skip a row for spacing
        ++row;

        // add row for totals
        // ------------------
        loanScheduleTableModel.addRow(new Object[][]{null, null});
        loanScheduleTableModel.addRow(new Object[][]{null, null});


        loanScheduleTable.setValueAt("Total", row, 0);
        loanScheduleTable.setValueAt("$" + nf.format(totalPayments), row, 1);
        loanScheduleTable.setValueAt("$" + nf.format(totalPrinPayments), row, 2);
        loanScheduleTable.setValueAt("$" + nf.format(totalIntPayments), row, 3);

        if (payFreq == PayFrequency.BI_WEEKLY.getLoanPeriod()) {
            paymentLabel.setText("Bi-Weekly Payment:");
        } else if (payFreq == PayFrequency.MONTHLY.getLoanPeriod()) {
            paymentLabel.setText("Monthly Payment:");
        } else if (payFreq == PayFrequency.SEMI_MONTHLY.getLoanPeriod()) {
            paymentLabel.setText("Semi-Monthly Payment:");
        } else {
            paymentLabel.setText("Weekly Payment:");
        }

        installPayValLabel.setText("$" + nf.format(payment));

        nf.setMinimumFractionDigits(3);
    }