public static int[] merge (int[] left, int[] right)
    {
        int bound = left.length + right.length;
        int[] list = new int[bound];
        int leftIndx = 0, rightIndx = 0;
        int leftRef = -9999, rightRef = -9999;

        for (int indx = 0; indx < bound; indx++) {

            if (leftIndx < left.length) {
                leftRef = left[leftIndx];
            } else {
                leftRef = 9999;
            }

            if (rightIndx < right.length) {
                rightRef = right[rightIndx];
            } else {
                rightRef = 9999;
            }

            if (leftRef < rightRef) {
                list[indx] = leftRef;
                leftIndx++;
            } else {
                list[indx] = rightRef;
                rightIndx++;
            }            
        }
        return (list);
    }