public final int partitionByBarCode(int lb, int ub) { // for an outline of how this works, see the partition method for name
		Person pivotElement = allPersons[lb];
		int max = logicalSize;
		int left = lb, right = ub;
		Person temp;

		while (left < right) {
			while ((allPersons[left].getBarCode() <= pivotElement.getBarCode()) && left + 1 < max) {
				left++;
			}
			while ((allPersons[right].getBarCode() > pivotElement.getBarCode()) && right - 1 >= 0) {
				right--;
			}
			if (left < right) {
				temp = allPersons[left];
				allPersons[left] = allPersons[right];
				allPersons[right] = temp;
			}
		}
		for (left = lb; left <= right && left + 1 < max; left++) {
			allPersons[left] = allPersons[left + 1];
		}
		allPersons[right] = pivotElement;
		return right;
	}