private static void quickSort(ArrayList<PERange> array, int start, int end) {
		int i = start; 	// index of left-to-right scan
		int k = end; 	// index of right-to-left scan

		if (end - start >= 1) {
			PERange pivot = array.get(start); 	
			while (k > i) {
				while (array.get(i).getBegin() <= pivot.getBegin()
						&& i <= end && k > i) {
					i++; 
				}
				
				while (array.get(k).getBegin() > pivot.getBegin()
						&& k >= start && k >= i) {
					k--; 
				}
				
				if (k > i) {
					swap(array, i, k); 
				}
			}
			swap(array, start, k); 	
			quickSort(array, start, k - 1); 	// quicksort the left partition
			quickSort(array, k + 1, end); 		// quicksort the right partition
		} 
		// if there is only one element in the partition, do not do any sorting
		else {
			// the array is sorted, so exit
			return; 
		}
	}