public void definePerBal(int sem) {
		String grandTotal = Integer.toString(0);
		DataBase.sem_SWPerBal_data[sem][DataBase.schoolGradeCount][DataBase.sem_SWPerBal_data[sem][0].length - 1] = Integer
				.toString(0);
		for (int colNum = 0; colNum < sem_SWPerBal_headers[sem].length; colNum++) {// Iterates
			// through every column
			if (colNum == 0) {// First column header is "P"
				sem_SWPerBal_headers[sem][colNum] = "Grade";
			} else if (colNum == sem_SWPerBal_headers[sem].length - 1) {// Final column header is "Total"
				sem_SWPerBal_headers[sem][colNum] = "Total";
			} else {// Else Period number is set as column header
				sem_SWPerBal_headers[sem][colNum] = "Prd "
						+ Integer.toString(colNum);
			}
			DataBase.sem_SWPerBal_data[sem][DataBase.schoolGradeCount][colNum] = Integer
					.toString(0);
		}
		for (int rowNum = 0; rowNum <= DataBase.schoolGradeCount; rowNum++) {// Iterates through each row
			DataBase.sem_SWPerBal_data[sem][rowNum][DataBase.sem_SWPerBal_data[sem][rowNum].length - 1] = Integer
					.toString(0);
			for (int colNum = 0; colNum <= DataBase.schoolPeriodCount; colNum++) {// Iterates through each row
				if (colNum == 0) {// Place Grade Number to first column
					if (rowNum < DataBase.schoolGradeCount)// Not bottom row
						DataBase.sem_SWPerBal_data[sem][rowNum][colNum] = "Gr "
								+ Integer
								.toString(9 + rowNum);
					else
						// if bottom row
						DataBase.sem_SWPerBal_data[sem][rowNum][colNum] = "Total";
				} else if (rowNum < DataBase.schoolGradeCount) {// Count total for the grade and period
					DataBase.sem_SWPerBal_data[sem][rowNum][colNum] = Integer
							.toString(countSections(sem, rowNum, colNum - 1));
					DataBase.sem_SWPerBal_data[sem][rowNum][DataBase.sem_SWPerBal_data[sem][rowNum].length - 1] = // And to gradeWide total
							Integer.toString(Integer
									.parseInt(DataBase.sem_SWPerBal_data[sem][rowNum][DataBase.sem_SWPerBal_data[sem][rowNum].length - 1])
									+ Integer
									.parseInt(DataBase.sem_SWPerBal_data[sem][rowNum][colNum]));
					DataBase.sem_SWPerBal_data[sem][DataBase.schoolGradeCount][colNum] = // Add to periodWide total
							Integer.toString(Integer
									.parseInt(DataBase.sem_SWPerBal_data[sem][DataBase.schoolGradeCount][colNum])
									+ Integer
									.parseInt(DataBase.sem_SWPerBal_data[sem][rowNum][colNum]));
					grandTotal = Integer
							.toString(Integer.parseInt(grandTotal)
									+ Integer
									.parseInt(DataBase.sem_SWPerBal_data[sem][rowNum][colNum]));
					//System.out.println("TOTAL is now: " + grandTotal);
				}
			}
		}
		DataBase.sem_SWPerBal_data[sem][DataBase.schoolGradeCount][DataBase.sem_SWPerBal_data[sem][0].length - 1] = grandTotal;
		sem_SWPerBalTables[sem]
				.setModel(new UneditableTableModel(
						DataBase.sem_SWPerBal_data[sem],
						sem_SWPerBal_headers[sem]));
	}