public static int[] concat(int[] x, int[] y){
        int[] sum = new int[x.length + y.length];
        for (int i = 0, j = 0; i < sum.length; i++, j++){
            if (i < x.length && j < x.length) sum[i] = x[j];
            if (j == x.length && i == x.length) j = 0;
            if (i >= x.length) sum[i] = y[j];
        }
        return sum;
    }