public void mergeSort()
  {
    // check if there is only 1 element return
    if (a.length == 1) return;
    
    // otherwise create two new arrays
    int[] left = new int[a.length / 2];
    for (int i = 0; i < left.length; i++)
      left[i] = a[i];
    int[] right = new int[a.length - left.length];
    for (int i = left.length, j=0; 
         i < a.length; i++, j++)
      right[j] = a[i];
    
    // create new ArraySorter objects
    ArraySorter sorter1 = new ArraySorter(left);
    sorter1.printArray("sorter1");
    ArraySorter sorter2 = new ArraySorter(right);
    sorter2.printArray("sorter2");
    
    // do the recursive call with the new sorters
    sorter1.mergeSort();
    sorter2.mergeSort();
    
    // merge the resulting arrays
    merge(left,right);
    this.printArray("After merge");
  }