Index: /applications/robust/main.cpp
===================================================================
--- /applications/robust/main.cpp (revision 1220)
+++ /applications/robust/main.cpp (revision 1234)
@@ -15,5 +15,7 @@
 int main ( int argc, char* argv[] ) {
 	
-	emlig* emlig1 = new emlig(8);	
+	emlig* emlig1 = new emlig(3);
+
+	//emlig1->step_me(0);
 
 	for(int i = 0;i<500;i++)
@@ -27,15 +29,15 @@
 		condition[2] = rand()/1000.0;
 		condition[3] = rand()/1000.0;
-		condition[4] = rand()/1000.0;
+		/*condition[4] = rand()/1000.0;
 		condition[5] = rand()/1000.0;
 		condition[6] = rand()/1000.0;
 		condition[7] = rand()/1000.0;
-		condition[8] = rand()/1000.0;
+		condition[8] = rand()/1000.0;*/
 		
 
-		vec* condition_vec = new vec(condition,9);
+		vec* condition_vec = new vec(condition,4);
 		emlig1->add_condition(*condition_vec);
 
-		// emlig1->step_me(i);
+		emlig1->step_me(i);
 		
 		vector<int> sizevector;
Index: /applications/robust/robustlib.h
===================================================================
--- /applications/robust/robustlib.h (revision 1224)
+++ /applications/robust/robustlib.h (revision 1234)
@@ -25,4 +25,19 @@
 class polyhedron;
 class vertex;
+
+/*
+class t_simplex
+{
+public:
+	set<vertex*> minima;
+
+	set<vertex*> simplex;
+
+	t_simplex(vertex* origin_vertex)
+	{
+		simplex.insert(origin_vertex);
+		minima.insert(origin_vertex);
+	}
+};*/
 
 /// A class describing a single polyhedron of the split complex. From a collection of such classes a Hasse diagram
@@ -83,5 +98,5 @@
 
 	/// List of triangulation polyhedrons of the polyhedron given by their relative vertices. 
-	list<list<vertex*>> triangulations;
+	list<set<vertex*>> triangulation;
 
 	/// A list of relative addresses serving for Hasse diagram construction.
@@ -155,4 +170,23 @@
 	}
 
+	void triangulate()
+	{		
+		for(list<polyhedron*>::iterator child_ref = children.begin();child_ref!=children.end();child_ref++)
+		{
+			for(list<set<vertex*>>::iterator t_ref = (*child_ref)->triangulation.begin();t_ref!=(*child_ref)->triangulation.end();t_ref++)
+			{
+				set<vertex*> new_simplex;
+				new_simplex.insert((*t_ref).begin(),(*t_ref).end());				
+
+				pair<set<vertex*>::iterator,bool> ret_val = new_simplex.insert(*vertices.begin());
+
+				if(ret_val.second == true)
+				{
+					triangulation.push_back(new_simplex);
+				} 
+			}
+		}		
+	}
+
 	
 };
@@ -178,4 +212,12 @@
 	{
 		this->coordinates = coordinates;
+
+		vertices.insert(this);
+
+		set<vertex*> vert_simplex;
+
+		vert_simplex.insert(this);
+
+		triangulation.push_back(vert_simplex);
 	}
 
@@ -855,4 +897,9 @@
 					negative_poly->vertices.insert(new_totally_neutral_child->vertices.begin(),new_totally_neutral_child->vertices.end());
 
+					new_totally_neutral_child->triangulate();
+
+					positive_poly->triangulate();
+					negative_poly->triangulate();
+
 					statistic.append_polyhedron(k-1, new_totally_neutral_child);
 					
@@ -897,9 +944,5 @@
 		// We create an origin - this point will have all the coordinates zero, but now it has an empty vector of coords.
 		vertex *origin = new vertex(origin_coord);
-
-		// It has itself as a vertex. There will be a nice use for this when the vertices of its parents are searched in
-		// the recursive creation procedure below.
-		origin->vertices.insert(origin);
-
+		
 		/*
 		// As a statistic, we have to create a vector of vectors of polyhedron pointers. It will then represent the Hasse
@@ -933,9 +976,6 @@
 
 			// Now we create the points
-			vertex *new_point1 = new vertex(origin_coord1);
-			vertex *new_point2 = new vertex(origin_coord2);
-
-			new_point1->vertices.insert(new_point1);
-			new_point2->vertices.insert(new_point2);
+			vertex* new_point1 = new vertex(origin_coord1);
+			vertex* new_point2 = new vertex(origin_coord2);			
 			
 			//*********************************************************************************************************
@@ -1032,22 +1072,16 @@
 					// The only new vertex of the offspring should be the newly created point.
 					current_copy1->vertices.insert(new_point1);
-					current_copy2->vertices.insert(new_point2);
+					current_copy2->vertices.insert(new_point2);					
 					
 					// This method guarantees that each polyhedron is already triangulated, therefore its triangulation
 					// is only one set of vertices and it is the set of all its vertices.
-					list<vertex*> triangulation1;
-					list<vertex*> triangulation2;
-
-					set<vertex*>::iterator copy2_ref = current_copy2->vertices.begin();
-					for(set<vertex*>::iterator copy1_ref = current_copy1->vertices.begin(); copy1_ref != current_copy1->vertices.end(); copy1_ref++)
-					{
-						triangulation1.push_back(*copy1_ref);
-						triangulation2.push_back(*copy2_ref);
-
-						copy2_ref++;
-					}
-
-					current_copy1->triangulations.push_back(triangulation1);
-					current_copy2->triangulations.push_back(triangulation2);
+					set<vertex*> t_simplex1;
+					set<vertex*> t_simplex2;
+
+					t_simplex1.insert(current_copy1->vertices.begin(),current_copy1->vertices.end());
+					t_simplex2.insert(current_copy2->vertices.begin(),current_copy2->vertices.end());
+					
+					current_copy1->triangulation.push_back(t_simplex1);
+					current_copy2->triangulation.push_back(t_simplex2);					
 					
 					// Now we have copied the polyhedron and we have to copy all of its relations. Because we are copying
