private void merge(char[] arr, char[] helper, int front, int mid, int rear) {

		// copy the original arr to helper arr
		// we need to do that,since every merge is actually modifying arr,
		// helper is just used to compare, it didn't change
		// so next merge we must update the helper first, which seems
		// inefficient
		for (int i = 0; i < arr.length; i++) {
			helper[i] = arr[i];
		}

		int leftPartIndex = front;
		int rightPartIndex = mid + 1;
		int current = front;

		while (leftPartIndex <= mid && rightPartIndex <= rear) {
			if (helper[leftPartIndex] <= helper[rightPartIndex]) {
				arr[current] = helper[leftPartIndex++];
			} else {
				arr[current] = helper[rightPartIndex++];
			}
			current++;
		}

		// put the remaining left into the arr
		for(int i = leftPartIndex; i <= mid; i++)
			arr[current++] = helper[i];
		
		// note, the remaining right is already there
	}