Index: src/boundary.cpp
===================================================================
--- src/boundary.cpp	(revision e4a379ed412421dc2eb4f0cd77c6fe6d7cc47ffa)
+++ src/boundary.cpp	(revision 7dea7c3ad9e0e608f067038eb1e30477fbd8360e)
@@ -572,22 +572,22 @@
 
   // third step: IsConvexRectangle
-  LineRunner = TesselStruct->LinesOnBoundary.begin();
-  LineAdvance = LineRunner;  // we need an advanced line, as the LineRunner might get removed
-  while (LineRunner != TesselStruct->LinesOnBoundary.end()) {
-    LineAdvance++;
-    line = LineRunner->second;
-    *out << Verbose(1) << "INFO: Current line is " << *line << "." << endl;
-    //if (LineAdvance != TesselStruct->LinesOnBoundary.end())
-      //*out << Verbose(1) << "INFO: Next line will be " << *(LineAdvance->second) << "." << endl;
-    if (!line->CheckConvexityCriterion(out)) {
-      *out << Verbose(1) << "... line " << *line << " is concave, flipping it." << endl;
-
-      // take highest of both lines
-      point = TesselStruct->IsConvexRectangle(out, line);
-      if (point != NULL)
-        volume += TesselStruct->RemovePointFromTesselatedSurface(out, point);
-    }
-    LineRunner = LineAdvance;
-  }
+//  LineRunner = TesselStruct->LinesOnBoundary.begin();
+//  LineAdvance = LineRunner;  // we need an advanced line, as the LineRunner might get removed
+//  while (LineRunner != TesselStruct->LinesOnBoundary.end()) {
+//    LineAdvance++;
+//    line = LineRunner->second;
+//    *out << Verbose(1) << "INFO: Current line is " << *line << "." << endl;
+//    //if (LineAdvance != TesselStruct->LinesOnBoundary.end())
+//      //*out << Verbose(1) << "INFO: Next line will be " << *(LineAdvance->second) << "." << endl;
+//    if (!line->CheckConvexityCriterion(out)) {
+//      *out << Verbose(1) << "... line " << *line << " is concave, flipping it." << endl;
+//
+//      // take highest of both lines
+//      point = TesselStruct->IsConvexRectangle(out, line);
+//      if (point != NULL)
+//        volume += TesselStruct->RemovePointFromTesselatedSurface(out, point);
+//    }
+//    LineRunner = LineAdvance;
+//  }
 
   CalculateConcavityPerBoundaryPoint(out, TesselStruct);
@@ -600,57 +600,4 @@
 };
 
-/** Calculates the concavity for each of the BoundaryPointSet's in a Tesselation.
- * Sets BoundaryPointSet::value equal to the number of connected lines that are not convex.
- * \param *out output stream for debugging
- * \param *TesselStruct pointer to Tesselation structure
- */
-void CalculateConcavityPerBoundaryPoint(ofstream *out, class Tesselation *TesselStruct)
-{
-  class BoundaryPointSet *point = NULL;
-  class BoundaryLineSet *line = NULL;
-  // calculate remaining concavity
-  for (PointMap::iterator PointRunner = TesselStruct->PointsOnBoundary.begin(); PointRunner != TesselStruct->PointsOnBoundary.end(); PointRunner++) {
-    point = PointRunner->second;
-    *out << Verbose(1) << "INFO: Current point is " << *point << "." << endl;
-    point->value = 0;
-    for (LineMap::iterator LineRunner = point->lines.begin(); LineRunner != point->lines.end(); LineRunner++) {
-      line = LineRunner->second;
-      *out << Verbose(2) << "INFO: Current line of point " << *point << " is " << *line << "." << endl;
-      if (!line->CheckConvexityCriterion(out))
-        point->value += 1;
-    }
-  }
-};
-
-/** Stores triangles to file.
- * \param *out output stream for debugging
- * \param *mol molecule with atoms and bonds
- * \param *filename prefix of filename
- * \param *extraSuffix intermediate suffix
- */
-void StoreTrianglesinFile(ofstream *out, molecule *mol, const char *filename, const char *extraSuffix)
-{
-  // 4. Store triangles in tecplot file
-  if (filename != NULL) {
-    if (DoTecplotOutput) {
-      string OutputName(filename);
-      OutputName.append(extraSuffix);
-      OutputName.append(TecplotSuffix);
-      ofstream *tecplot = new ofstream(OutputName.c_str());
-      WriteTecplotFile(out, tecplot, mol->TesselStruct, mol, 0);
-      tecplot->close();
-      delete(tecplot);
-    }
-    if (DoRaster3DOutput) {
-      string OutputName(filename);
-      OutputName.append(extraSuffix);
-      OutputName.append(Raster3DSuffix);
-      ofstream *rasterplot = new ofstream(OutputName.c_str());
-      WriteRaster3dFile(out, rasterplot, mol->TesselStruct, mol);
-      rasterplot->close();
-      delete(rasterplot);
-    }
-  }
-};
 
 /** Determines the volume of a cluster.
@@ -699,6 +646,36 @@
 
   return volume;
-}
-;
+};
+
+/** Stores triangles to file.
+ * \param *out output stream for debugging
+ * \param *mol molecule with atoms and bonds
+ * \param *filename prefix of filename
+ * \param *extraSuffix intermediate suffix
+ */
+void StoreTrianglesinFile(ofstream *out, molecule *mol, const char *filename, const char *extraSuffix)
+{
+  // 4. Store triangles in tecplot file
+  if (filename != NULL) {
+    if (DoTecplotOutput) {
+      string OutputName(filename);
+      OutputName.append(extraSuffix);
+      OutputName.append(TecplotSuffix);
+      ofstream *tecplot = new ofstream(OutputName.c_str());
+      WriteTecplotFile(out, tecplot, mol->TesselStruct, mol, 0);
+      tecplot->close();
+      delete(tecplot);
+    }
+    if (DoRaster3DOutput) {
+      string OutputName(filename);
+      OutputName.append(extraSuffix);
+      OutputName.append(Raster3DSuffix);
+      ofstream *rasterplot = new ofstream(OutputName.c_str());
+      WriteRaster3dFile(out, rasterplot, mol->TesselStruct, mol);
+      rasterplot->close();
+      delete(rasterplot);
+    }
+  }
+};
 
 /** Creates multiples of the by \a *mol given cluster and suspends them in water with a given final density.
@@ -990,5 +967,4 @@
 void FindNonConvexBorder(ofstream *out, molecule* mol, class LinkedCell *LCList, const double RADIUS, const char *filename = NULL)
 {
-  int N = 0;
   bool freeLC = false;
 
@@ -1005,6 +981,6 @@
   LineMap::iterator testline;
   *out << Verbose(0) << "Begin of FindNonConvexBorder\n";
-  bool flag = false;  // marks whether we went once through all baselines without finding any without two triangles
-  bool failflag = false;
+  bool OneLoopWithoutSuccessFlag = false;  // marks whether we went once through all baselines without finding any without two triangles
+  bool TesselationFailFlag = false;
 
   // initialise Linked Cell
@@ -1020,19 +996,20 @@
   baseline = mol->TesselStruct->LinesOnBoundary.begin();
   baseline++; // skip first line
-  while ((baseline != mol->TesselStruct->LinesOnBoundary.end()) || (flag)) {
+  while ((baseline != mol->TesselStruct->LinesOnBoundary.end()) || (OneLoopWithoutSuccessFlag)) {
     if (baseline->second->triangles.size() == 1) {
       // 3. find next triangle
-      failflag = mol->TesselStruct->FindNextSuitableTriangle(out, *(baseline->second), *(((baseline->second->triangles.begin()))->second), RADIUS, LCList); //the line is there, so there is a triangle, but only one.
-      flag = flag || failflag;
-      if (!failflag)
+      TesselationFailFlag = mol->TesselStruct->FindNextSuitableTriangle(out, *(baseline->second), *(((baseline->second->triangles.begin()))->second), RADIUS, LCList); //the line is there, so there is a triangle, but only one.
+      OneLoopWithoutSuccessFlag = OneLoopWithoutSuccessFlag || TesselationFailFlag;
+      if (!TesselationFailFlag)
         cerr << "WARNING: FindNextSuitableTriangle failed." << endl;
 
       // write temporary envelope
       if (filename != NULL) {
-        if ((DoSingleStepOutput && ((mol->TesselStruct->TrianglesOnBoundary.size() % SingleStepWidth == 0) || (mol->TesselStruct->TrianglesOnBoundary.size() > 8520 && mol->TesselStruct->TrianglesOnBoundary.size() <= 8530)))) { // if we have a new triangle and want to output each new triangle configuration
+        if ((DoSingleStepOutput && ((mol->TesselStruct->TrianglesOnBoundary.size() % SingleStepWidth == 0)))) { // if we have a new triangle and want to output each new triangle configuration
           mol->TesselStruct->Output(out, filename, mol);
         }
       }
       baseline = mol->TesselStruct->LinesOnBoundary.end();
+      *out << Verbose(2) << "Baseline set to end." << endl;
     } else {
       //cout << Verbose(1) << "Line " << *baseline->second << " has " << baseline->second->triangles.size() << " triangles adjacent" << endl;
@@ -1041,11 +1018,13 @@
     }
 
-    N++;
-    if ((baseline == mol->TesselStruct->LinesOnBoundary.end()) && (flag)) {
+    if ((baseline == mol->TesselStruct->LinesOnBoundary.end()) && (OneLoopWithoutSuccessFlag)) {
       baseline = mol->TesselStruct->LinesOnBoundary.begin();   // restart if we reach end due to newly inserted lines
-      baseline++;
-      flag = false;
-    }
-  }
+      OneLoopWithoutSuccessFlag = false;
+    }
+    baseline++;
+  }
+  // check envelope for consistency
+  CheckListOfBaselines(out, mol->TesselStruct);
+
   // look whether all points are inside of the convex envelope, otherwise add them via degenerated triangles
   mol->TesselStruct->InsertStraddlingPoints(out, mol, LCList);
@@ -1067,14 +1046,6 @@
   mol->TesselStruct->RemoveDegeneratedTriangles();
 
-  cout << Verbose(2) << "Check: List of Baselines with not two connected triangles:" << endl;
-  int counter = 0;
-  for (testline = mol->TesselStruct->LinesOnBoundary.begin(); testline != mol->TesselStruct->LinesOnBoundary.end(); testline++) {
-    if (testline->second->triangles.size() != 2) {
-      cout << Verbose(2) << *testline->second << "\t" << testline->second->triangles.size() << endl;
-      counter++;
-    }
-  }
-  if (counter == 0)
-    *out << Verbose(2) << "None." << endl;
+  // check envelope for consistency
+  CheckListOfBaselines(out, mol->TesselStruct);
 
   // write final envelope
Index: src/boundary.hpp
===================================================================
--- src/boundary.hpp	(revision e4a379ed412421dc2eb4f0cd77c6fe6d7cc47ffa)
+++ src/boundary.hpp	(revision 7dea7c3ad9e0e608f067038eb1e30477fbd8360e)
@@ -36,5 +36,4 @@
 void FindNextSuitablePoint(class BoundaryTriangleSet *BaseTriangle, class BoundaryLineSet *BaseLine, atom*& OptCandidate, Vector *OptCandidateCenter, double *ShortestAngle, const double RADIUS, LinkedCell *LC);
 Boundaries *GetBoundaryPoints(ofstream *out, molecule *mol);
-void CalculateConcavityPerBoundaryPoint(ofstream *out, class Tesselation *TesselStruct);
 void StoreTrianglesinFile(ofstream *out, molecule *mol, const char *filename, const char *extraSuffix);
 bool RemoveAllBoundaryPoints(ofstream *out, class Tesselation *TesselStruct, molecule *mol, char *filename);
Index: src/tesselation.cpp
===================================================================
--- src/tesselation.cpp	(revision e4a379ed412421dc2eb4f0cd77c6fe6d7cc47ffa)
+++ src/tesselation.cpp	(revision 7dea7c3ad9e0e608f067038eb1e30477fbd8360e)
@@ -215,9 +215,9 @@
     node = runner->second->GetThirdEndpoint(this);
     if (node != NULL) {
-      *out << Verbose(3) << "INFO: Third node for triangle " << *(runner->second) << " is " << *node << " at " << *(node->node->node) << "." << endl;
+      //*out << Verbose(3) << "INFO: Third node for triangle " << *(runner->second) << " is " << *node << " at " << *(node->node->node) << "." << endl;
       helper[i].CopyVector(node->node->node);
       helper[i].SubtractVector(&BaseLineCenter);
       helper[i].MakeNormalVector(&BaseLine);  // we want to compare the triangle's heights' angles!
-      *out << Verbose(4) << "INFO: Height vector with respect to baseline is " << helper[i] << "." << endl;
+      //*out << Verbose(4) << "INFO: Height vector with respect to baseline is " << helper[i] << "." << endl;
       i++;
     } else {
@@ -226,5 +226,5 @@
     }
   }
-  *out << Verbose(3) << "INFO: BaselineNormal is " << BaseLineNormal << "." << endl;
+  //*out << Verbose(3) << "INFO: BaselineNormal is " << BaseLineNormal << "." << endl;
   if (NormalCheck.NormSquared() < MYEPSILON) {
     *out << Verbose(3) << "ACCEPT: Normalvectors of both triangles are the same: convex." << endl;
@@ -374,7 +374,7 @@
  * We call Vector::GetIntersectionWithPlane() to receive the intersection point with the plane
  * This we test if it's really on the plane and whether it's inside the triangle on the plane or not.
- * The latter is done as follows: if it's really outside, then for any endpoint of the triangle and it's opposite
- * base line, the intersection between the line from endpoint to intersection and the base line will have a Vector::NormSquared()
- * smaller than the first line.
+ * The latter is done as follows: We calculate the cross point of one of the triangle's baseline with the line
+ * given by the intersection and the third basepoint. Then, we check whether it's on the baseline (i.e. between
+ * the first two basepoints) or not.
  * \param *out output stream for debugging
  * \param *MolCenter offset vector of line
@@ -408,8 +408,8 @@
     exit(255);
   }
-  CrossPoint.SubtractVector(endpoints[i%3]->node->node);
+  CrossPoint.SubtractVector(endpoints[i%3]->node->node);  // cross point was returned as absolute vector
 
   // check whether intersection is inside or not by comparing length of intersection and length of cross point
-  if ((CrossPoint.NormSquared() - helper.NormSquared()) > -MYEPSILON) { // inside
+  if ((CrossPoint.NormSquared() - helper.NormSquared()) < MYEPSILON) { // inside
     return true;
   } else { // outside!
@@ -439,4 +439,16 @@
   for(int i=0;i<3;i++)
     if (point == endpoints[i])
+      return true;
+  return false;
+};
+
+/** Checks whether point is any of the three endpoints this triangle contains.
+ * \param *point TesselPoint to test
+ * \return true - point is of the triangle, false - is not
+ */
+bool BoundaryTriangleSet::ContainsBoundaryPoint(class TesselPoint *point)
+{
+  for(int i=0;i<3;i++)
+    if (point == endpoints[i]->node)
       return true;
   return false;
@@ -1088,20 +1100,27 @@
   Vector *Center = cloud->GetCenter(out);
   list<BoundaryTriangleSet*> *triangles = NULL;
+  bool AddFlag = false;
+  LinkedCell *BoundaryPoints = NULL;
 
   *out << Verbose(1) << "Begin of InsertStraddlingPoints" << endl;
 
   cloud->GoToFirst();
+  BoundaryPoints = new LinkedCell(this, 5.);
   while (!cloud->IsEnd()) {  // we only have to go once through all points, as boundary can become only bigger
-    LinkedCell BoundaryPoints(this, 5.);
+    if (AddFlag) {
+      delete(BoundaryPoints);
+      BoundaryPoints = new LinkedCell(this, 5.);
+      AddFlag = false;
+    }
     Walker = cloud->GetPoint();
     *out << Verbose(2) << "Current point is " << *Walker << "." << endl;
     // get the next triangle
-    triangles = FindClosestTrianglesToPoint(out, Walker->node, &BoundaryPoints);
-    if (triangles == NULL) {
-      *out << Verbose(1) << "No triangles found, probably a tesselation point itself." << endl;
+    triangles = FindClosestTrianglesToPoint(out, Walker->node, BoundaryPoints);
+    BTS = triangles->front();
+    if ((triangles == NULL) || (BTS->ContainsBoundaryPoint(Walker))) {
+      *out << Verbose(2) << "No triangles found, probably a tesselation point itself." << endl;
       cloud->GoToNext();
       continue;
     } else {
-      BTS = triangles->front();
     }
     *out << Verbose(2) << "Closest triangle is " << *BTS << "." << endl;
@@ -1126,4 +1145,5 @@
         // add Walker to boundary points
         *out << Verbose(2) << "Adding " << *Walker << " to BoundaryPoints." << endl;
+        AddFlag = true;
         if (AddBoundaryPoint(Walker,0))
           NewPoint = BPS[0];
@@ -1279,6 +1299,6 @@
 };
 
-/** Function tries to add Triangle just created to Triangle and remarks if already existent (Failure of algorithm).
- * Furthermore it adds the triangle to all of its lines, in order to recognize those which are saturated later.
+/** Function adds triangle to global list.
+ * Furthermore, the triangle receives the next free id and id counter \a TrianglesOnBoundaryCount is increased.
  */
 void Tesselation::AddTesselationTriangle()
@@ -1289,4 +1309,21 @@
   TrianglesOnBoundary.insert(TrianglePair(TrianglesOnBoundaryCount, BTS));
   TrianglesOnBoundaryCount++;
+
+  // set as last new triangle
+  LastTriangle = BTS;
+
+  // NOTE: add triangle to local maps is done in constructor of BoundaryTriangleSet
+};
+
+/** Function adds triangle to global list.
+ * Furthermore, the triangle number is set to \a nr.
+ * \param nr triangle number
+ */
+void Tesselation::AddTesselationTriangle(int nr)
+{
+  cout << Verbose(1) << "Adding triangle to global TrianglesOnBoundary map." << endl;
+
+  // add triangle to global map
+  TrianglesOnBoundary.insert(TrianglePair(nr, BTS));
 
   // set as last new triangle
@@ -2097,5 +2134,5 @@
     BTS = new class BoundaryTriangleSet(BLS, OldTriangleNrs[0]);
     BTS->GetNormalVector(BaseLineNormal);
-    TrianglesOnBoundary.insert(TrianglePair(OldTriangleNrs[0], BTS));
+    AddTesselationTriangle(OldTriangleNrs[0]);
     *out << Verbose(3) << "INFO: Created new triangle " << *BTS << "." << endl;
 
@@ -2105,5 +2142,5 @@
     BTS = new class BoundaryTriangleSet(BLS, OldTriangleNrs[1]);
     BTS->GetNormalVector(BaseLineNormal);
-    TrianglesOnBoundary.insert(TrianglePair(OldTriangleNrs[1], BTS));
+    AddTesselationTriangle(OldTriangleNrs[1]);
     *out << Verbose(3) << "INFO: Created new triangle " << *BTS << "." << endl;
   } else {
@@ -2481,5 +2518,5 @@
   }
   if (trianglePoints[0]->node->DistanceSquared(x) < MYEPSILON) {
-    *out << Verbose(2) << "Point is right on a tesselation point, no nearest triangle." << endl;
+    *out << Verbose(3) << "Point is right on a tesselation point, no nearest triangle." << endl;
     PointMap::iterator PointRunner = PointsOnBoundary.find(trianglePoints[0]->nr);
     triangles = new list<BoundaryTriangleSet*>;
@@ -2512,12 +2549,12 @@
         *out << Verbose(1) << "ERROR: IsInnerPoint encounters serious error, point " << i << " not found." << endl;
       }
-      *out << Verbose(1) << "List of triangle points:" << endl;
-      *out << Verbose(2) << *trianglePoints[i] << endl;
+      //*out << Verbose(2) << "List of triangle points:" << endl;
+      //*out << Verbose(3) << *trianglePoints[i] << endl;
     }
 
     triangles = FindTriangles(trianglePoints);
-    *out << Verbose(1) << "List of possible triangles:" << endl;
+    *out << Verbose(2) << "List of possible triangles:" << endl;
     for(list<BoundaryTriangleSet*>::iterator Runner = triangles->begin(); Runner != triangles->end(); Runner++)
-      *out << Verbose(2) << **Runner << endl;
+      *out << Verbose(3) << **Runner << endl;
 
     delete(connectedClosestPoints);
@@ -3299,4 +3336,6 @@
   int count  = 0;
 
+  cout << Verbose(1) << "Begin of RemoveDegeneratedTriangles" << endl;
+
   for (map<int, int>::iterator TriangleKeyRunner = DegeneratedTriangles->begin();
     TriangleKeyRunner != DegeneratedTriangles->end(); ++TriangleKeyRunner
@@ -3370,4 +3409,5 @@
 
   cout << Verbose(1) << "RemoveDegeneratedTriangles() removed " << count << " triangles:" << endl;
+  cout << Verbose(1) << "End of RemoveDegeneratedTriangles" << endl;
 }
 
Index: src/tesselation.hpp
===================================================================
--- src/tesselation.hpp	(revision e4a379ed412421dc2eb4f0cd77c6fe6d7cc47ffa)
+++ src/tesselation.hpp	(revision 7dea7c3ad9e0e608f067038eb1e30477fbd8360e)
@@ -126,4 +126,5 @@
     bool ContainsBoundaryLine(class BoundaryLineSet *line);
     bool ContainsBoundaryPoint(class BoundaryPointSet *point);
+    bool ContainsBoundaryPoint(class TesselPoint *point);
     class BoundaryPointSet *GetThirdEndpoint(class BoundaryLineSet *line);
     bool IsPresentTupel(class BoundaryPointSet *Points[3]);
@@ -204,4 +205,5 @@
     void AlwaysAddTesselationTriangleLine(class BoundaryPointSet *a, class BoundaryPointSet *b, int n);
     void AddTesselationTriangle();
+    void AddTesselationTriangle(int nr);
     void RemoveTesselationTriangle(class BoundaryTriangleSet *triangle);
     void RemoveTesselationLine(class BoundaryLineSet *line);
Index: src/tesselationhelpers.cpp
===================================================================
--- src/tesselationhelpers.cpp	(revision e4a379ed412421dc2eb4f0cd77c6fe6d7cc47ffa)
+++ src/tesselationhelpers.cpp	(revision 7dea7c3ad9e0e608f067038eb1e30477fbd8360e)
@@ -598,5 +598,5 @@
   for(int i=0;i<NDIM;i++) // store indices of this cell
     N[i] = LC->n[i];
-  cout << Verbose(2) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl;
+  cout << Verbose(3) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl;
 
   LC->GetNeighbourBounds(Nlower, Nupper);
@@ -828,2 +828,55 @@
   }
 };
+
+/** Calculates the concavity for each of the BoundaryPointSet's in a Tesselation.
+ * Sets BoundaryPointSet::value equal to the number of connected lines that are not convex.
+ * \param *out output stream for debugging
+ * \param *TesselStruct pointer to Tesselation structure
+ */
+void CalculateConcavityPerBoundaryPoint(ofstream *out, class Tesselation *TesselStruct)
+{
+  class BoundaryPointSet *point = NULL;
+  class BoundaryLineSet *line = NULL;
+
+  //*out << Verbose(2) << "Begin of CalculateConcavityPerBoundaryPoint" << endl;
+  // calculate remaining concavity
+  for (PointMap::iterator PointRunner = TesselStruct->PointsOnBoundary.begin(); PointRunner != TesselStruct->PointsOnBoundary.end(); PointRunner++) {
+    point = PointRunner->second;
+    *out << Verbose(1) << "INFO: Current point is " << *point << "." << endl;
+    point->value = 0;
+    for (LineMap::iterator LineRunner = point->lines.begin(); LineRunner != point->lines.end(); LineRunner++) {
+      line = LineRunner->second;
+      //*out << Verbose(2) << "INFO: Current line of point " << *point << " is " << *line << "." << endl;
+      if (!line->CheckConvexityCriterion(out))
+        point->value += 1;
+    }
+  }
+  //*out << Verbose(2) << "End of CalculateConcavityPerBoundaryPoint" << endl;
+};
+
+
+/** Checks whether each BoundaryLineSet in the Tesselation has two triangles.
+ * \param *out output stream for debugging
+ * \param *TesselStruct
+ * \return true - all have exactly two triangles, false - some not, list is printed to screen
+ */
+bool CheckListOfBaselines(ofstream *out, Tesselation *TesselStruct)
+{
+  LineMap::iterator testline;
+  bool result = false;
+  int counter = 0;
+
+  *out << Verbose(1) << "Check: List of Baselines with not two connected triangles:" << endl;
+  for (testline = TesselStruct->LinesOnBoundary.begin(); testline != TesselStruct->LinesOnBoundary.end(); testline++) {
+    if (testline->second->triangles.size() != 2) {
+      *out << Verbose(1) << *testline->second << "\t" << testline->second->triangles.size() << endl;
+      counter++;
+    }
+  }
+  if (counter == 0) {
+    *out << Verbose(1) << "None." << endl;
+    result = true;
+  }
+  return result;
+}
+
Index: src/tesselationhelpers.hpp
===================================================================
--- src/tesselationhelpers.hpp	(revision e4a379ed412421dc2eb4f0cd77c6fe6d7cc47ffa)
+++ src/tesselationhelpers.hpp	(revision 7dea7c3ad9e0e608f067038eb1e30477fbd8360e)
@@ -50,4 +50,7 @@
 void IncludeSphereinRaster3D(ofstream *out, ofstream *rasterfile, class Tesselation *Tess, PointCloud *cloud);
 void WriteVrmlFile(ofstream *out, ofstream *vrmlfile, class Tesselation *Tess, PointCloud *cloud);
+void CalculateConcavityPerBoundaryPoint(ofstream *out, class Tesselation *TesselStruct);
+
+bool CheckListOfBaselines(ofstream *out, Tesselation *TesselStruct);
 
 
