public void sort(int start, int end) {
        if (end - start <= 1) {
            return;
        }

        int middle = (start + end) / 2;

        Thread th = new Thread(new MergeSort(array, start, middle));
        th.start();
        sort(middle, end);
        
        try {
            th.join();
        } catch (InterruptedException ex) {
            System.out.println(Thread.currentThread() + " interrupted unexpectedly");
            return;
        }

        merge(start, middle, end);
    }