private static int[] h2GA(int[] vals){
	    	//yh=0, mh=1, dh=2, yg=3, mg=4, dg=5, dayweek=6
	    	int[] out = vals;
	        int yh1 = 0, mh1 = 0/*, yg1 = 0, mg1 = 0, dg1 = 0, dw1 = 0*/;
	        /*find the date of the begining of the month*/
	        /* make sure values are within the allowed values */
	        if (out[2] > 30)
	        {
	            out[2] = 1;
	            out[1]++;
	        }
	         
	        if (out[2] < 1)
	        {
	            out[2] = 1;
	            out[1]--;
	        }
	         
	        if (out[1] > 12)
	        {
	            out[1] = 1;
	            out[0]++;
	        }
	         
	        if (out[1] < 1)
	        {
	            out[1] = 12;
	            out[0]--;
	        }
	         
	        int[] result = bH2GA(out[0],out[1]);
	        out[3] = result[0];
	        out[4] = result[1];
	        out[5] = result[2];
	        out[6] = result[3];
	        out[5] = out[5] + out[2] - 1;
	        int[] resultGDate = gDateAjust(out[3],out[4],out[5]);
	        out[3] = resultGDate[0];
	        out[4] = resultGDate[1];
	        out[5] = resultGDate[2];
	        /* Make sure that dates are within the correct values */
	        out[6] = out[6] + out[2] - 1;
	        out[6] = out[6] % 7;
	        /*find the date of the begining of the next month*/
	        if (out[2] == 30)
	        {
	            mh1 = out[1] + 1;
	            yh1 = out[0];
	            if (mh1 > 12)
	            {
	                mh1 = mh1 - 12;
	                yh1++;
	            }
	             
	            result = bH2GA(yh1,mh1);
	            if (out[5] == result[2])
	            {
	                out[0] = yh1;
	                out[1] = mh1;
	                out[2] = 1;
	            }
	             
	        }
	         
	        return out;
	    }