Index: /issm/trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp
===================================================================
--- /issm/trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp	(revision 13329)
+++ /issm/trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp	(revision 13330)
@@ -29,16 +29,14 @@
 WRAPPER(ContourToMesh){
 
-	int i,j;
-
 	/* required input: */
-	int     edgevalue;
-	double *index      = NULL;
-	int     nel;
-	double *x          = NULL;
-	int     nods;
-	double *y          = NULL;
-	char   *interptype = NULL;
-	char* contourname  = NULL;
-	DataSet* contours  = NULL;
+	int      edgevalue;
+	double  *index       = NULL;
+	int      nel;
+	double  *x           = NULL;
+	int      nods;
+	double  *y           = NULL;
+	char    *interptype  = NULL;
+	char    *contourname = NULL;
+	DataSet *contours    = NULL;
 
 	/* output: */
@@ -91,4 +89,3 @@
 	/*end module: */
 	MODULEEND();
-	
 }
Index: /issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp
===================================================================
--- /issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp	(revision 13329)
+++ /issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp	(revision 13330)
@@ -11,5 +11,4 @@
 	_printLine_("      x,y: list of nodes.");
 	_printLine_("      contourname: name of .exp file containing the contours, or resulting structure from call to expread.");
-	_printLine_("      interptype: string definining type of interpolation ('element', or 'node').");
 	_printLine_("      edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons.");
 	_printLine_("      flags: vector of flags (0 or 1), of size nods.");
@@ -18,21 +17,13 @@
 WRAPPER(ContourToNodes){
 
-	int i,j;
-
-	/* required input: */
-	int     edgevalue;
-	double *x          = NULL;
-	double *y          = NULL;
-	char   *interptype = NULL;
+	/* input: */
+	int      edgevalue,nods;
+	double  *x           = NULL;
+	double  *y           = NULL;
+	char    *contourname = NULL;
+	DataSet *contours    = NULL;
 
 	/* output: */
 	SeqVec<double> *flags = NULL;
-	int  nods;
-
-	/*contours*/
-	int numcontours;
-	mxArray         *matlabstructure = NULL;
-	Contour<double> **contours       = NULL;
-	Contour<double> *contouri        = NULL;
 
 	/*Boot module: */
@@ -40,5 +31,5 @@
 
 	/*checks on arguments on the matlab side: */
-	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ContourToNodesUsage);
+	CHECKARGUMENTS(NLHS,NRHS,&ContourToNodesUsage);
 	
 	/*Fetch inputs: */
@@ -46,30 +37,9 @@
 	FetchData(&y,NULL,NULL,YHANDLE);
 	FetchData(&edgevalue,EDGEVALUEHANDLE);
+	FetchData(&contourname,CONTOURNAME);
+	contours=DomainOutlineRead<double>(contourname);
 
-	/*Fetch contours*/
-	if(mxIsChar(FILENAME)){
-		/*Call expread on filename to build a contour array in the matlab workspace: */
-		mexCallMATLAB(1,&matlabstructure,1,(mxArray**)&FILENAME,"expread");
-	}
-	else{
-		/*FILENAME is actually a structure, coming directly from expread: */
-		matlabstructure=(mxArray*)FILENAME;
-	}
-
-	numcontours=mxGetNumberOfElements(matlabstructure);
-	contours=xNew<Contour<double>*>(numcontours);
-	for(i=0;i<numcontours;i++){
-		//allocate
-		contouri=xNew<Contour<double> >(1);
-		//retrieve dimension of this contour.
-		contouri->nods=(int)mxGetScalar(mxGetField(matlabstructure,i,"nods"));
-		//set pointers.
-		contouri->x=mxGetPr(mxGetField(matlabstructure,i,"x"));
-		contouri->y=mxGetPr(mxGetField(matlabstructure,i,"y"));
-		*(contours+i)=contouri;
-	}
-
-	/*Run interpolation routine: */
-	ContourToNodesx(&flags,x,y,nods,contours,numcontours,edgevalue);
+	/*Run x layer */
+	ContourToNodesx(&flags,x,y,nods,contours,edgevalue);
 
 	/* output: */
Index: /issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h
===================================================================
--- /issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h	(revision 13329)
+++ /issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h	(revision 13330)
@@ -30,5 +30,5 @@
 #define XHANDLE         prhs[0]
 #define YHANDLE         prhs[1]
-#define FILENAME        prhs[2]
+#define CONTOURNAME     prhs[2]
 #define EDGEVALUEHANDLE prhs[3]
 
@@ -41,5 +41,5 @@
 #define XHANDLE         PyTuple_GetItem(args,0)
 #define YHANDLE         PyTuple_GetItem(args,1)
-#define FILENAME        PyTuple_GetItem(args,2)
+#define CONTOURNAME     PyTuple_GetItem(args,2)
 #define EDGEVALUEHANDLE PyTuple_GetItem(args,3)
 
Index: /issm/trunk-jpl/src/modules/python/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/modules/python/Makefile.am	(revision 13329)
+++ /issm/trunk-jpl/src/modules/python/Makefile.am	(revision 13330)
@@ -7,4 +7,5 @@
 lib_LTLIBRARIES = BamgConvertMesh.la\
 						BamgMesher.la\
+						ContourToNodes.la\
 						ElementConnectivity.la\
 						EnumToString.la\
@@ -64,4 +65,8 @@
 BamgMesher_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
 
+ContourToNodes_la_SOURCES = ../ContourToNodes/ContourToNodes.cpp\
+									 ../ContourToNodes/ContourToNodes.h
+ContourToNodes_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
+
 ElementConnectivity_la_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp\
 											../ElementConnectivity/ElementConnectivity.h
