public void insertionSort (int[] array, int a, int b) {

        int i = a, j = a-1;

        while (i <= b) {
            int key = array[i];
            int k = i-1;
            while (k > -1 && array[k] > key) {
                array[k+1] = array[k];
                k--;
            }

            if (k+1 != i) {
                array[k+1] = key;
            }
            i++;
        }
    }