public final int partitionByName(int lb, int  ub)
	{
		Product pivotElement = allProducts[lb]; // store the left most value as the pivot element
		int max = logicalSize;
		int left = lb, right = ub; // store left and right as the unchanging values of lb and ub respectively. This is used for the final move of this method
		Product temp; // create a temp for swapping thing around.

		while (left < right)
		{
			while((allProducts[left].getName().compareToIgnoreCase(pivotElement.getName()) <= 0) && left+1 < max) { // test the order of the products on left side
				left++;
			}
			while((allProducts[right].getName().compareToIgnoreCase(pivotElement.getName()) > 0) && right -1 >= 0) { // test the order of the products on right side
				right--;
			}
			if (left < right) // swap the left and right products, remember that temp variable, this is where it shines.
			{
				temp        = allProducts[left];
				allProducts[left]  = allProducts[right];
				allProducts[right] = temp;
			}
		}
		for(left = lb; left <= right && left+1 < max; left++) { //move the products one place to the left for all products after the pivot element
			allProducts[left] = allProducts[left +1];
		}
		allProducts[right] = pivotElement; // move the pivot element to its place at right, where it is now in the correct order.
		return right; // return the new pivot (see quick sort)
	}