private void merge(int left, int middle1, int middle2, int right) {
        
        int leftIndex = left;
        int rightIndex = middle2;
        
        int combinedIndex = left;
        
        int[] combined = new int[data.length];
        
        System.out.println("merge:    "+subarray(left, middle1));
        System.out.println("          "+subarray(middle2, right));
        
        
        
        while(leftIndex <= middle1 && rightIndex <= right) {
            if(data[leftIndex] <= data[rightIndex]) {
                combined[combinedIndex++] = data[leftIndex++];
            }
            else {
                combined[combinedIndex++] = data[rightIndex++];
            }
        }
        
        if(leftIndex == middle2) {
            while(rightIndex <= right) {
                combined[combinedIndex++] = data[rightIndex++];
            }
        }
        
        else {
            while(leftIndex <=middle1) {
                combined[combinedIndex++] = data[leftIndex++];
            }
        }
        
        
        for(int i = left; i <= right; i++) {
            data[i] = combined[i];
        }
        
        
        System.out.println("           "+subarray(left, right));
        System.out.println("");
    }