void reHeapElement( heap q, double[] v, int length, int i )
	{
	  int up, here;
	  here = i;
	  up = i / 2;
	  if ((up > 0) && (v[p[here]] < v[p[up]]))
	  {
		  /// we push the new value up the heap
		  while ((up > 0) && (v[p[here]] < v[p[up]])) 
	      {
			  swap(q,up,here);
			  here = up;
			  up = here / 2;
	      }
	  }
	  else
	    	heapify(q,v,i,length);
	}