Index: /issm/trunk-jpl/src/c/bamg/BamgMesh.cpp
===================================================================
--- /issm/trunk-jpl/src/c/bamg/BamgMesh.cpp	(revision 18454)
+++ /issm/trunk-jpl/src/c/bamg/BamgMesh.cpp	(revision 18455)
@@ -5,5 +5,5 @@
 BamgMesh::BamgMesh(){/*{{{*/
 
-	this->VerticesSize[0]=0,                  this->VerticesSize[1]=0;                 this->Vertices=NULL;
+	this->VerticesSize[0]=0,                  this->VerticesSize[1]=0;                 this->Vertices=NULL;          this->PreviousNumbering = NULL;
 	this->EdgesSize[0]=0,                     this->EdgesSize[1]=0;                    this->Edges=NULL;
 	this->TrianglesSize[0]=0,                 this->TrianglesSize[1]=0;                this->Triangles=NULL;
@@ -30,4 +30,5 @@
 
 	xDelete<double>(this->Vertices);
+	xDelete<double>(this->PreviousNumbering);
 	xDelete<double>(this->Edges);
 	xDelete<double>(this->Triangles);
Index: /issm/trunk-jpl/src/c/bamg/BamgMesh.h
===================================================================
--- /issm/trunk-jpl/src/c/bamg/BamgMesh.h	(revision 18454)
+++ /issm/trunk-jpl/src/c/bamg/BamgMesh.h	(revision 18455)
@@ -11,4 +11,5 @@
 		int     VerticesSize[2];
 		double* Vertices;
+		double* PreviousNumbering;
 		int     EdgesSize[2];
 		double* Edges;
Index: /issm/trunk-jpl/src/c/bamg/BamgVertex.cpp
===================================================================
--- /issm/trunk-jpl/src/c/bamg/BamgVertex.cpp	(revision 18454)
+++ /issm/trunk-jpl/src/c/bamg/BamgVertex.cpp	(revision 18455)
@@ -10,4 +10,9 @@
 namespace bamg {
 
+	/*Constructor/Destructor*/
+	BamgVertex::BamgVertex(){ /*{{{*/
+		this->PreviousNumber = 0;
+	}/*}}}*/
+
 	/*Methods*/
 	void BamgVertex::Echo(void){/*{{{*/
@@ -17,4 +22,5 @@
 		_printf_("  Euclidean coordinates r.x: " << r.x << ", r.y: " << r.y << "\n");
 		_printf_("  ReferenceNumber = " << ReferenceNumber << "\n");
+		_printf_("  PreviousNumber  = " << PreviousNumber << "\n");
 		m.Echo();
 
Index: /issm/trunk-jpl/src/c/bamg/BamgVertex.h
===================================================================
--- /issm/trunk-jpl/src/c/bamg/BamgVertex.h	(revision 18454)
+++ /issm/trunk-jpl/src/c/bamg/BamgVertex.h	(revision 18455)
@@ -23,4 +23,5 @@
 			Metric    m;
 			long      ReferenceNumber;
+			long      PreviousNumber;
 			Direction DirOfSearch;
 			short     IndexInTriangle;              // the vertex number in triangle; varies between 0 and 2 in t
@@ -42,4 +43,5 @@
 
 			/*methods (No constructor and no destructors...)*/
+			BamgVertex();
 			double Smoothing(Mesh & ,const Mesh & ,Triangle  * & ,double =1);
 			void   MetricFromHessian(const double Hxx,const double Hyx, const double Hyy, const double smin,const double smax,const double s,const double err,BamgOpts* bamgopts);
Index: /issm/trunk-jpl/src/c/bamg/Mesh.cpp
===================================================================
--- /issm/trunk-jpl/src/c/bamg/Mesh.cpp	(revision 18454)
+++ /issm/trunk-jpl/src/c/bamg/Mesh.cpp	(revision 18455)
@@ -571,10 +571,12 @@
 		bamgmesh->VerticesSize[0]=nbv;
 		bamgmesh->VerticesSize[1]=3;
-		if (nbv){
+		if(nbv){
 			bamgmesh->Vertices=xNew<double>(3*nbv);
+			bamgmesh->PreviousNumbering=xNew<double>(nbv);
 			for (i=0;i<nbv;i++){
 				bamgmesh->Vertices[i*3+0]=vertices[i].r.x;
 				bamgmesh->Vertices[i*3+1]=vertices[i].r.y;
 				bamgmesh->Vertices[i*3+2]=vertices[i].GetReferenceNumber();
+				bamgmesh->PreviousNumbering[i]=vertices[i].PreviousNumber;
 			}
 		}
@@ -3146,5 +3148,6 @@
 				BamgVertex &bv=Bh[i];
 				if (!bv.GeomEdgeHook){
-					vertices[nbv].r   = bv.r;
+					vertices[nbv].r              = bv.r;
+					vertices[nbv].PreviousNumber = i+1;
 					vertices[nbv++].m = bv.m;
 				}
Index: /issm/trunk-jpl/src/m/classes/bamgmesh.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/bamgmesh.m	(revision 18454)
+++ /issm/trunk-jpl/src/m/classes/bamgmesh.m	(revision 18455)
@@ -23,4 +23,5 @@
 		CrackedVertices=[];
 		CrackedEdges=[];
+		PreviousNumbering=[];
 		% }}}
 	end
