void GMEaddSpecies( node v, double[][] D, double[][] A ) 
	{
		edge e; // loop variable
		edge e_min; //points to best edge seen thus far
		double w_min = 0.0;   //used to keep track of tree weights

		// initialize variables as necessary
		//CASE 1: T is empty, v is the first node
		//create a tree with v as only vertex, no edges
		if ( this.root == null )  
		{
			this.root = v;  
			//	note that we are rooting T arbitrarily at a leaf.  
			// T.root is not the phylogenetic root
			v.index = 0;
			this.size = 1;
			return;     
		}
		// CASE 2: T is a single-vertex tree
		if ( this.size == 1 )
		{
			v.index = 1;
			e = new edge( "E1", this.root, v, 0.0 );
			e.topsize = 1;
			e.bottomsize = 1;
			A[v.index][v.index] = D[v.index2][this.root.index2];
			this.root.leftEdge = v.parentEdge = e;
			this.size = 2;
			return; 
		}
		// CASE 3: T has at least two nodes and an edge.  
		// Insert new node by breaking one of the edges
		v.index = this.size;
	 	GMEcalcNewvAverages( v, D, A );
		 /*calcNewvAverges will assign values to all the edge averages of T which
		   include the node v.  Will do so using pre-existing averages in T and
		   information from A,D*/
	 	e_min = this.root.leftEdge;  
	 	e = e_min.head.leftEdge;  
	 	while ( null != e )
	 	{
	 		testEdge(e,v,A); 
	 		/*testEdge tests weight of tree if loop variable 
			e is the edge split, places this weight in e.totalweight field */
	 		if ( e.totalweight < w_min )
	 		{
	 			e_min = e;
	 			w_min = e.totalweight;
	 		}
	 		e = topFirstTraverse(e);
	 	}
	 	/*e_min now points at the edge we want to split*/
	 	GMEsplitEdge(v,e_min,A);
	}