private static void msdSort(String[] a, String[] aux, int l, int h, int d) {
		
		int CUTOFF = 15;
		if (h <= l + CUTOFF) {
			isort(a, aux, l, h, d);
			return;
		}
		
		int R = 256;
		int[] count = new int[R + 2];
		
		// count frequencies
		for (int i = l; i <= h; i++) {
			int c = charAt(a[i], d);
			count[c + 2]++;
		}
		
		// accumulate
		for (int r = 0; r < R + 1; r++)
			count[r + 1] += count[r];
		
		// sort
		for (int i = l; i <= h; i++) {
			int c = charAt(a[i], d);
			aux[count[c + 1]++] = a[i];
		}
		
		// copy
		for (int i = l; i <= h; i++)
			a[i] = aux[i - l];
		
		// solve sub-arrays
		for (int r = 0; r < R; r++)
			msdSort(a, aux, l + count[r], l + count[r + 1] - 1, d + 1);
	}