Index: /issm/trunk/src/c/Bamgx/Mesh2.h
===================================================================
--- /issm/trunk/src/c/Bamgx/Mesh2.h	(revision 2988)
+++ /issm/trunk/src/c/Bamgx/Mesh2.h	(revision 2989)
@@ -6,12 +6,4 @@
 #include "../include/macros.h"
 #include "../toolkits/toolkits.h"
-
-//From MeshIo
-#include <cstdio>
-#include <cstring>
-#include <cstdlib>
-#include <cctype>
-#include <stdlib.h>
-#include <math.h>
 
 #include "meshtype.h"
@@ -817,4 +809,28 @@
 	/*}}}1*/
 
+	inline void Vertex::Set(const Vertex & rec,const Triangles & ,Triangles & ){ 
+		*this  = rec;
+	  }
+	inline void GeometricalVertex::Set(const GeometricalVertex & rec,const Geometry & ,const Geometry & ){ 
+		*this  = rec;
+	  }
+	inline void VertexOnVertex::Set(const Triangles & Th ,Int4 i,Triangles & ThNew) { 
+		*this = Th.VertexOnBThVertex[i];  
+		v = ThNew.vertices + Th.Number(v);
+
+	  }
+	Int4 inline  Vertex::Optim(int i,int koption){ 
+		Int4 ret=0;
+		if ( t && (vint >= 0 ) && (vint <3) )
+		  {
+			ret = t->Optim(vint,koption);
+			if(!i) 
+			  {
+				t =0; // for no future optime 
+				vint= 0; }
+		  }
+		return ret;
+	  }
+
 	// to sort in descending order
 	template<class T>  inline void  HeapSort(T *c,long n){
@@ -902,12 +918,5 @@
 	  }
 
-	inline void Vertex::Set(const Vertex & rec,const Triangles & ,Triangles & )
-	  { 
-		*this  = rec;
-	  }
-	inline void GeometricalVertex::Set(const GeometricalVertex & rec,const Geometry & ,const Geometry & )
-	  { 
-		*this  = rec;
-	  }
+
 	inline void Edge::Set(const Triangles & Th ,Int4 i,Triangles & ThNew)
 	  { 
@@ -950,10 +959,5 @@
 		 link = ThNew.triangles + Th.Number(link);
 	  }
-	inline void VertexOnVertex::Set(const Triangles & Th ,Int4 i,Triangles & ThNew)
-	  { 
-		*this = Th.VertexOnBThVertex[i];  
-		v = ThNew.vertices + Th.Number(v);
-
-	  }
+
 	inline void SubDomain::Set(const Triangles & Th ,Int4 i,Triangles & ThNew)
 	  {
@@ -1133,23 +1137,10 @@
 	  }
 
-	Int4 inline  Vertex::Optim(int i,int koption)
-	  { 
-		Int4 ret=0;
-		if ( t && (vint >= 0 ) && (vint <3) )
-		  {
-			ret = t->Optim(vint,koption);
-			if(!i) 
-			  {
-				t =0; // for no future optime 
-				vint= 0; }
-		  }
-		return ret;
-	  }
-
-	Icoor2 inline det(const Vertex & a,const Vertex & b,const Vertex & c)
-	  {
+
+	Icoor2 inline det(const Vertex & a,const Vertex & b,const Vertex & c){
 		register  Icoor2 bax = b.i.x - a.i.x ,bay = b.i.y - a.i.y; 
 		register  Icoor2 cax = c.i.x - a.i.x ,cay = c.i.y - a.i.y; 
-		return  bax*cay - bay*cax;}
+		return  bax*cay - bay*cax;
+	  }
 
 
@@ -1158,10 +1149,6 @@
 					Vertex *s1,Vertex *s2,Icoor2 det1,Icoor2 det2);
 
-
-
 		int inline TriangleAdjacent::swap()
 		  { return  t->swap(a);}
-
-
 
 		int SwapForForcingEdge(Vertex   *  & pva ,Vertex  * &   pvb ,
@@ -1171,7 +1158,5 @@
 		int ForceEdge(Vertex &a, Vertex & b,TriangleAdjacent & taret) ;
 
-		// inline bofbof   FH 
-		inline  TriangleAdjacent FindTriangleAdjacent(Edge &E)
-		  {
+		inline  TriangleAdjacent FindTriangleAdjacent(Edge &E){
 			Vertex * a = E.v[0];
 			Vertex * b = E.v[1];
@@ -1202,6 +1187,7 @@
 		  }
 
-		inline Vertex * TheVertex(Vertex * a) // give a unique vertex with smallest number
-		  { // in case on crack in mesh 
+		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;
Index: /issm/trunk/src/c/Bamgx/Metric.h
===================================================================
--- /issm/trunk/src/c/Bamgx/Metric.h	(revision 2988)
+++ /issm/trunk/src/c/Bamgx/Metric.h	(revision 2989)
@@ -1,7 +1,7 @@
-#ifndef TYPEMETRIX
-#define TYPEMETRIX Metric
-#endif
+#ifndef _METRIC_H
+#define _METRIC_H
 
-//#include "R2.h"
+#include "R2.h"
+
 namespace bamg {
 
@@ -121,4 +121,4 @@
 		return ( Abs(la - lb) <1.0e-6*Max3(la,lb,1.0e-20))  ? s : (exp(s*lab*(la-lb)/(la*lb))-1)*lb/(la-lb);
 	}
-
 }
+#endif
Index: /issm/trunk/src/c/Bamgx/QuadTree.h
===================================================================
--- /issm/trunk/src/c/Bamgx/QuadTree.h	(revision 2988)
+++ /issm/trunk/src/c/Bamgx/QuadTree.h	(revision 2989)
@@ -1,2 +1,5 @@
+#ifndef _QUADTREE_H
+#define _QUADTREE_H
+
 #include "../shared/shared.h"
 #include "../include/macros.h"
@@ -63,2 +66,3 @@
 	};
 }
+#endif
Index: /issm/trunk/src/c/Bamgx/R2.h
===================================================================
--- /issm/trunk/src/c/Bamgx/R2.h	(revision 2988)
+++ /issm/trunk/src/c/Bamgx/R2.h	(revision 2989)
@@ -1,2 +1,5 @@
+#ifndef _R2_H
+#define _R2_H
+
 namespace bamg {
 
@@ -96,2 +99,3 @@
 	  } 
 }
+#endif
Index: /issm/trunk/src/c/Bamgx/SetOfE4.h
===================================================================
--- /issm/trunk/src/c/Bamgx/SetOfE4.h	(revision 2988)
+++ /issm/trunk/src/c/Bamgx/SetOfE4.h	(revision 2989)
@@ -36,4 +36,3 @@
 	};
 }
-
 #endif 
