private void BMEupdateAveragesMatrix( double[][] A, edge e, node v, 
		node newNode )
	{
		edge sib, par, left, right;
		//first, update the v,newNode entries
		A[newNode.index][newNode.index] = 0.5*(A[e.head.index][e.head.index]
		    + A[v.index][e.head.index]);
		A[v.index][newNode.index] = A[newNode.index][v.index] = 
	        A[v.index][e.head.index];
		A[v.index][v.index] = 
	        0.5*(A[e.head.index][v.index] + A[v.index][e.head.index]);
		left = e.head.leftEdge;
		right = e.head.rightEdge;
		if (null != left) // updates left and below
	        updateSubTree( A,left,v,e.head,newNode,0.25,direction.UP ); 
		if (null != right) // updates right and below
			updateSubTree( A,right,v,e.head,newNode,0.25,direction.UP ); 
		sib = e.siblingEdge();
		if (null != sib) // updates sib and below
			updateSubTree( A,sib,v,e.head,newNode,0.25,direction.SKEW ); 
		par = e.tail.parentEdge;
		if ( null != par) // updates par and above
			updateSubTree( A, par, v, e.head, newNode, 0.25, direction.DOWN );
		/*must change values A[e.head][*] last, as they are used to update
	    	the rest of the matrix*/
	  	A[newNode.index][e.head.index] = A[e.head.index][newNode.index]
	  	    = A[e.head.index][e.head.index];
	  	A[v.index][e.head.index] = A[e.head.index][v.index];
	  //updates e.head fields only
	  	updatePair( A, e, e, v, e.head, 0.5, direction.UP ); 
	}