Index: /issm/trunk/src/c/Bamgx/BamgObjects.h
===================================================================
--- /issm/trunk/src/c/Bamgx/BamgObjects.h	(revision 3235)
+++ /issm/trunk/src/c/Bamgx/BamgObjects.h	(revision 3236)
@@ -28,4 +28,6 @@
 #include "objects/Triangles.h"
 #include "objects/Geometry.h"
+
+#include "shared/shared.h"
 
 namespace bamg {
@@ -160,32 +162,4 @@
 		return TriangleAdjacent(0,0);//for compiler
 	}
-	inline Vertex* TheVertex(Vertex * a){
-		// give a unique vertex with smallest number
-		// in case on crack in mesh 
-		Vertex * r(a), *rr;
-		Triangle * t = a->t;
-		int i = a->vint;
-		TriangleAdjacent ta(t,EdgesVertexTriangle[i][0]); // Previous edge
-		if (!t || i<0 || i>=3){
-			throw ErrorException(__FUNCT__,exprintf("!t || i<0 !! i>=3"));
-		}
-		if ( a!=(*t)(i)){
-			throw ErrorException(__FUNCT__,exprintf("a!=(*t)(i)"));
-		}
-		int k=0;
-		do { // turn around vertex in direct sens (trigo)
-			k++;
-			if (k>=20000){
-				throw ErrorException(__FUNCT__,exprintf("k>=20000"));
-			}
-			//  in no crack => ta.EdgeVertex(1) == a
-			if ((rr=ta.EdgeVertex(0)) < r) r = rr;
-			ta = ta.Adj();
-			if ((rr=ta.EdgeVertex(1)) < r) r =rr;
-			--ta;
-		} while (t != (Triangle*) ta);  
-		return r;
-	}
-
 	/*}}}1*/
 
@@ -271,6 +245,5 @@
 			else if (TriaAdjSharedEdge[0] & 16 || TriaAdjSharedEdge[1] & 16  || TriaAdjSharedEdge[2] & 16 || t->TriaAdjSharedEdge[0] & 16 || t->TriaAdjSharedEdge[1] & 16 || t->TriaAdjSharedEdge[2] & 16 )
 			 q= -1;
-			else if(option) 
-			  { 
+			else if(option){ 
 				const Vertex & v2 = *TriaVertices[VerticesOfTriangularEdge[a][0]];
 				const Vertex & v0 = *TriaVertices[VerticesOfTriangularEdge[a][1]];
@@ -278,5 +251,5 @@
 				const Vertex & v3 = * t->TriaVertices[OppositeEdge[TriaAdjSharedEdge[a]&3]];
 				q =  QuadQuality(v0,v1,v2,v3); // do the float part
-			  }
+			}
 			else q= 1;
 		}
Index: /issm/trunk/src/c/Bamgx/objects/CrackedEdge.h
===================================================================
--- /issm/trunk/src/c/Bamgx/objects/CrackedEdge.h	(revision 3235)
+++ /issm/trunk/src/c/Bamgx/objects/CrackedEdge.h	(revision 3236)
@@ -12,4 +12,5 @@
 #include "Edge.h"
 #include "Triangle.h"
+#include "../shared/TheVertex.h"
 
 namespace bamg {
Index: /issm/trunk/src/c/Bamgx/objects/Vertex.cpp
===================================================================
--- /issm/trunk/src/c/Bamgx/objects/Vertex.cpp	(revision 3235)
+++ /issm/trunk/src/c/Bamgx/objects/Vertex.cpp	(revision 3236)
@@ -92,5 +92,5 @@
 						Real8 qold =QuadQuality(*v0,*v1,*v2,*v3);
 						vP = vPnew;
-						Real8 qnew = QuadQuality(*v0,*v1,*v2,*v3);
+						Real8 qnew =QuadQuality(*v0,*v1,*v2,*v3);
 						if (qnew<qold) ok = 1;
 					  }
Index: /issm/trunk/src/c/Bamgx/objects/Vertex.h
===================================================================
--- /issm/trunk/src/c/Bamgx/objects/Vertex.h	(revision 3235)
+++ /issm/trunk/src/c/Bamgx/objects/Vertex.h	(revision 3236)
@@ -52,10 +52,7 @@
 			inline Int4 Optim(int =1,int =0); 
 			inline void Set(const Vertex & rec,const Triangles &,Triangles &);
-
-
 	};
 
 	//FOR NOW (WARNING)
-	inline Vertex* TheVertex(Vertex * a); // for remove crak in mesh 
 	double QuadQuality(const Vertex &,const Vertex &,const Vertex &,const Vertex &);
 }
Index: /issm/trunk/src/c/Bamgx/shared/TheVertex.h
===================================================================
--- /issm/trunk/src/c/Bamgx/shared/TheVertex.h	(revision 3236)
+++ /issm/trunk/src/c/Bamgx/shared/TheVertex.h	(revision 3236)
@@ -0,0 +1,38 @@
+#ifndef _THEVERTEX_H_
+#define _THEVERTEX_H_
+
+#include "../meshtype.h"
+#include "../objects/Vertex.h"
+
+namespace bamg {
+
+	inline Vertex* TheVertex(Vertex * a){// for remove crak in mesh 
+		// give a unique vertex with smallest number
+		// in case on crack in mesh 
+		Vertex * r(a), *rr;
+		Triangle * t = a->t;
+		int i = a->vint;
+		TriangleAdjacent ta(t,EdgesVertexTriangle[i][0]); // Previous edge
+		if (!t || i<0 || i>=3){
+			throw ErrorException(__FUNCT__,exprintf("!t || i<0 !! i>=3"));
+		}
+		if ( a!=(*t)(i)){
+			throw ErrorException(__FUNCT__,exprintf("a!=(*t)(i)"));
+		}
+		int k=0;
+		do { // turn around vertex in direct sens (trigo)
+			k++;
+			if (k>=20000){
+				throw ErrorException(__FUNCT__,exprintf("k>=20000"));
+			}
+			//  in no crack => ta.EdgeVertex(1) == a
+			if ((rr=ta.EdgeVertex(0)) < r) r = rr;
+			ta = ta.Adj();
+			if ((rr=ta.EdgeVertex(1)) < r) r =rr;
+			--ta;
+		} while (t != (Triangle*) ta);  
+		return r;
+	}
+
+}
+#endif
Index: /issm/trunk/src/c/Bamgx/shared/shared.h
===================================================================
--- /issm/trunk/src/c/Bamgx/shared/shared.h	(revision 3235)
+++ /issm/trunk/src/c/Bamgx/shared/shared.h	(revision 3236)
@@ -15,4 +15,5 @@
 #include "SwapForForcingEdge.h"
 #include "swap.h"
+#include "TheVertex.h"
 
 #endif
Index: /issm/trunk/src/c/Bamgx/shared/swap.h
===================================================================
--- /issm/trunk/src/c/Bamgx/shared/swap.h	(revision 3235)
+++ /issm/trunk/src/c/Bamgx/shared/swap.h	(revision 3236)
@@ -13,7 +13,4 @@
 namespace bamg {
 
-	//class Vertex;
-	//class Triangle;
-
 	void  swap(Triangle *t1,Int1 a1, Triangle *t2,Int1 a2, Vertex *s1,Vertex *s2,Icoor2 det1,Icoor2 det2);
 
