private static void percDown( int[] a, int i, int n ){   
		 int child;
	     int tmp;
	     
	     for (tmp = a[i] ; leftchild( i ) < n; i = child ) {
	    	 child = leftchild(i);
	    	 if (child<=n-1 && a[child] < a[child+1]) {
				child++;
				
	    	    if (tmp < a[child]) {
	    	    	int l = a[i];
	    		    a[i] = a[child];
	    		    a[child] = l;
			    }	    	    
	    	 }
	    	 
	    	 else if (child<=n-1 && a[child] > a[child+1]) {
	    		 if (tmp < a[child]) {
	    			 int l = a[i];
		    		 a[i] = a[child];
		    		 a[child] = l;				
				    }
			 }	    				
		 }
	 }