Index: /issm/trunk-jpl/src/wrappers/ExpSimplify/ExpSimplify.cpp
===================================================================
--- /issm/trunk-jpl/src/wrappers/ExpSimplify/ExpSimplify.cpp	(revision 14344)
+++ /issm/trunk-jpl/src/wrappers/ExpSimplify/ExpSimplify.cpp	(revision 14345)
@@ -14,6 +14,5 @@
 	_pprintLine_("      - tol:  tolerance (maximal euclidean distance allowed between the new line and a vertex)");
 	_pprintLine_("      Additional options:");
-	_pprintLine_("      - 'remove1': remove singleton from exp file (default is true)");
-	_pprintLine_("      - 'remove2': remove pairs from exp file (default is true)");
+	_pprintLine_("      - 'min': minimum number of vertices to save contours in exp file (default is 3)");
 	_pprintLine_("");
 	_pprintLine_("   Example:");
@@ -97,6 +96,6 @@
 	char*    expfile  = NULL;
 	double   tolerance;
-	bool     remove1,remove2,save;
 	Options *options      = NULL;
+	int      minimumvertices;
 
 	/*output*/
@@ -131,6 +130,6 @@
 
 	/*Process options*/
-	options->Get(&remove1,"remove1",true);
-	options->Get(&remove2,"remove2",true);
+	options->Get(&minimumvertices,"min",3);
+	if(minimumvertices<1) _error_("'min' (minimum number of verties) should be a positive integer");
 
 	/*Read old contours and allocate new contours*/
@@ -181,16 +180,6 @@
 
 		/*Do we save new profile?*/
-		save = true;
-		if(newnods==0){
-			save = false;
-		}
-		else if(remove1 && newnods==1){
-			save = false;
-		}
-		else if(remove2 && newnods==2){
-			save = false;
-		}
-		if(save){
-			printf("   New     number of vertices in contour #%i: %i\n",counter+1,newnods);
+		if(newnods>=minimumvertices){
+			printf("   Final   number of vertices in contour #%i: %i\n",counter+1,newnods);
 			newcontour       = xNew<Contour<double> >(1);
 			newcontour->nods = newnods;
@@ -211,5 +200,5 @@
 		}
 		else{
-			printf("   New     number of vertices in contour #%i: %i (not saved)\n",counter+1,newnods);
+			printf("   Final   number of vertices in contour #%i: %i (not saved)\n",counter+1,newnods);
 		}
 
@@ -217,4 +206,6 @@
 		xDelete<bool>(flags);
 	}
+	printf("   Initial number of contours: %i\n",oldcontours->Size());
+	printf("   Final   number of contours: %i\n",newcontours->Size());
 
 	/*Write data: */
