private Integer[] mergeArrays(int low, int high, int middle) {

        // Copy both parts into the helper array
        System.arraycopy(numbers, low, helper, low, high + 1 - low);

        int i = low;

        int j = middle + 1;

        int k = low;

        // Copy the smallest values from either the left or the right side back to the original array
        while (i <= middle && j <= high) {
            if (helper[i] <= helper[j]) {
                numbers[k] = helper[i];
                i++;
            } else {
                numbers[k] = helper[j];
                j++;
            }
            k++;
        }

        // Copy the rest of the left side of the array into the target array
        while (i <= middle) {
            numbers[k] = helper[i];
            k++;
            i++;
        }
        return numbers;
    }