Index: /issm/trunk-jpl/src/modules/BamgMesher/BamgMesher.cpp
===================================================================
--- /issm/trunk-jpl/src/modules/BamgMesher/BamgMesher.cpp	(revision 12048)
+++ /issm/trunk-jpl/src/modules/BamgMesher/BamgMesher.cpp	(revision 12049)
@@ -32,5 +32,5 @@
 	FetchData(&bamgmesh_in,BAMGGEOMIN);
 
-	/*!Generate internal degree of freedom numbers: */
+	/*Call x layer*/
 	Bamgx(bamgmesh_out,bamggeom_out,bamgmesh_in,bamggeom_in,bamgopts);
 
Index: /issm/trunk-jpl/src/modules/Exp2Kml/Exp2Kml.cpp
===================================================================
--- /issm/trunk-jpl/src/modules/Exp2Kml/Exp2Kml.cpp	(revision 12048)
+++ /issm/trunk-jpl/src/modules/Exp2Kml/Exp2Kml.cpp	(revision 12049)
@@ -25,27 +25,19 @@
 	/*checks on arguments on the matlab side: */
 	if (nlhs > NLHS) {
-		Exp2KmlUsage();
-		_error_("Exp2Kml usage error");
+		Exp2KmlUsage(); _error_("Exp2Kml usage error");
 	}
 	if (nrhs < NRHS) {
-		Exp2KmlUsage();
-		_error_("Exp2Kml usage error");
+		Exp2KmlUsage(); _error_("Exp2Kml usage error");
 	}
 
 	/*Input datasets: */
-	if (verbose) printf("Fetching inputs:\n");
 	FetchData(&filexp,EXP_IN);
-	if (verbose) printf("  filexp=\"%s\"\n",filexp);
 	FetchData(&filkml,KML_IN);
-	if (verbose) printf("  filkml=\"%s\"\n",filkml);
 	FetchData(&sgn,SGN_IN);
-	if (verbose) printf("  sgn=%d\n",sgn);
+	FetchData(&options,NRHS,nrhs,prhs);
 
-	if (verbose) printf("Parsing options:\n");
-	options=new Options(NRHS,nrhs,prhs);
-	if (options->Size()) for(i=0;i<options->Size();i++) ((Option*)options->GetObjectByOffset(i))->DeepEcho();
 	options->Get(&choles,"holes","no");
-	if (!strncmp(choles,"y",1) || !strncmp(choles,"on",2))
-		holes=true;
+	if (!strncmp(choles,"y",1) || !strncmp(choles,"on",2)) holes=true;
+
 	/*  defaults are in Xy2lldef, so don't duplicate them here, and only use user values if both have been specified  */
 	if (options->GetOption("central_meridian") || options->GetOption("standard_parallel")) {
@@ -57,21 +49,13 @@
 
 	/*some checks*/
-	if (verbose) printf("Checking inputs:\n");
-
-	if (sgn != +1 && sgn != -1) _error_("Hemisphere sgn=%d must be +1 (north) or -1 (south).",sgn);
+	if (sgn !=+1 && sgn !=-1) _error_("Hemisphere sgn=%d must be +1 (north) or -1 (south).",sgn);
 	if (fabs(cm)      > 180.) _error_("Central meridian cm=%g must be between -180 (west) and +180 (east) degrees.",cm);
 	if (sp < 0. || sp >  90.) _error_("Standard parallel sp=%g must be between 0 and 90 degrees (in specified hemisphere).",sp);
 
 	/* Run core computations: */
-	if (verbose) printf("Calling core:\n");
 	if (options->GetOption("central_meridian") && options->GetOption("standard_parallel"))
-		iret=Exp2Kmlx(filexp,filkml,
-					  sgn,cm,sp,
-					  holes);
+		iret=Exp2Kmlx(filexp,filkml,sgn,cm,sp,holes);
 	else
-		iret=Exp2Kmlx(filexp,filkml,
-					  sgn,
-					  holes);
-	if (verbose) printf("  iret=%d\n",iret);
+		iret=Exp2Kmlx(filexp,filkml,sgn,holes);
 
 	/*Write data: */
@@ -88,6 +72,5 @@
 }
 
-void Exp2KmlUsage(void)
-{
+void Exp2KmlUsage(void){
 	_printf_(true,"Exp2Kml - exp to kml file conversion module:\n");
 	_printf_(true,"\n");
Index: /issm/trunk-jpl/src/modules/KMLFileRead/KMLFileRead.cpp
===================================================================
--- /issm/trunk-jpl/src/modules/KMLFileRead/KMLFileRead.cpp	(revision 12048)
+++ /issm/trunk-jpl/src/modules/KMLFileRead/KMLFileRead.cpp	(revision 12049)
@@ -11,37 +11,25 @@
 	/*input: */
 	char*   name=NULL;
-
 	char*   notes=NULL;
 	const mxArray* notesi;
 	mwIndex        nindex;
-
 	int*    elem=NULL;
 	int     melem=0,nelem=0;
-
 	int*    nodecon=NULL;
 	int     mncon=0,nncon=0;
-
 	double* lat=NULL;
 	int     mlat=0,nlat=0,llat=0;
-
 	double* lng=NULL;
 	int     mlng=0,nlng=0,llng=0;
-
 	int     nparts=0;
-
 	int*    part=NULL;
 	int     mprt=0,nprt=0,lprt=0;
-
 	double* data=NULL;
 	int     mdata=0,ndata=0;
-
 	double* cmap=NULL;
 	int     mcmap=0,ncmap=0;
-
 	char*   filnam=NULL;
-
 	FILE*   fidi=NULL;
 	FILE*   fido=NULL;
-
 	Options* options=NULL;
 	char*    echo    =NULL;
@@ -57,20 +45,15 @@
 	/*checks on arguments on the matlab side: */
 	if (nlhs > NLHS) {
-		KMLFileReadUsage();
-		_error_("KMLFileRead usage error");
+		KMLFileReadUsage(); _error_("KMLFileRead usage error");
 	}
 	if (nrhs < NRHS) {
-		KMLFileReadUsage();
-		_error_("KMLFileRead usage error");
+		KMLFileReadUsage(); _error_("KMLFileRead usage error");
 	}
 
 	/*Input datasets: */
-	if (verbose) printf("Fetching inputs:\n");
 	FetchData(&filnam,FILENAME);
-	if (verbose) printf("  filnam =\"%s\"\n",filnam);
+	FetchData(&options,NRHS,nrhs,prhs);
+	FetchData(&options,NRHS,nrhs,prhs);
 
-	if (verbose) printf("Parsing options:\n");
-	options=new Options(NRHS,nrhs,prhs);
-	if (options->Size()) for(i=0;i<options->Size();i++) ((Option*)options->GetObjectByOffset(i))->DeepEcho();
 	options->Get(&echo    ,"echo"    ,"off");
 	options->Get(&deepecho,"deepecho","off");
@@ -78,8 +61,5 @@
 
 	/*some checks*/
-	if (verbose) printf("Checking inputs:\n");
-
-	if (!strlen(filnam))
-		strcpy(filnam,"stdout");
+	if (!strlen(filnam)) strcpy(filnam,"stdout");
 
 	if (verbose) printf("Opening file \"%s\".\n",filnam);
@@ -93,5 +73,5 @@
 	fclose(fidi);
 
-	if (kobj) {
+	if (kobj){
 		if (!strncmp(echo    ,"on",2) || !strncmp(echo    ,"y",1))
 			kobj->Echo();
@@ -110,5 +90,4 @@
 			}
 		}
-
 		delete kobj;
 	}
@@ -127,6 +106,5 @@
 }
 
-void KMLFileReadUsage(void)
-{
+void KMLFileReadUsage(void){
 	_printf_(true,"KMLFileRead - KML file reader module:\n");
 	_printf_(true,"\n");
Index: /issm/trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp
===================================================================
--- /issm/trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp	(revision 12048)
+++ /issm/trunk-jpl/src/modules/KMLMeshWrite/KMLMeshWrite.cpp	(revision 12049)
@@ -10,36 +10,24 @@
 	/*input: */
 	char*   name=NULL;
-
 	char*   notes=NULL;
 	const mxArray* notesi;
 	mwIndex        nindex;
-
 	int*    elem=NULL;
 	int     melem=0,nelem=0;
-
 	int*    nodecon=NULL;
 	int     mncon=0,nncon=0;
-
 	double* lat=NULL;
 	int     mlat=0,nlat=0,llat=0;
-
 	double* lng=NULL;
 	int     mlng=0,nlng=0,llng=0;
-
 	int     nparts=0;
-
 	int*    part=NULL;
 	int     mprt=0,nprt=0,lprt=0;
-
 	double* data=NULL;
 	int     mdata=0,ndata=0;
-
 	double* cmap=NULL;
 	int     mcmap=0,ncmap=0;
-
 	char*   filnam=NULL;
-
 	FILE*   fid=NULL;
-
 	Options* options=NULL;
 
@@ -52,16 +40,12 @@
 	/*checks on arguments on the matlab side: */
 	if (nlhs > NLHS) {
-		KMLMeshWriteUsage();
-		_error_("KMLMeshWrite usage error");
+		KMLMeshWriteUsage(); _error_("KMLMeshWrite usage error");
 	}
 	if (nrhs < NRHS) {
-		KMLMeshWriteUsage();
-		_error_("KMLMeshWrite usage error");
+		KMLMeshWriteUsage(); _error_("KMLMeshWrite usage error");
 	}
 
 	/*Input datasets: */
-	if (verbose) printf("Fetching inputs:\n");
 	FetchData(&name,NAME);
-	if (verbose) printf("  name   =\"%s\"\n",name);
 
 /*  notes is typically a cell array of character strings  */
@@ -85,44 +69,22 @@
 	else
 		FetchData(&notes,NOTES);
-	if (verbose) printf("  notes  =\"%s\"\n",notes);
-
 	FetchData(&elem,&melem,&nelem,ELEMHANDLE);
-	if (verbose) printf("  elem   =size [%d x %d]\n",melem,nelem);
 	FetchData(&nodecon,&mncon,&nncon,NODECONHANDLE);
-	if (verbose) printf("  nodecon=size [%d x %d]\n",mncon,nncon);
 	FetchData(&lat,&mlat,&nlat,LATHANDLE);
 	llat=mlat*nlat;
-	if (verbose) printf("  lat    =length [%d]\n",llat);
 	FetchData(&lng,&mlng,&nlng,LNGHANDLE);
 	llng=mlng*nlng;
-	if (verbose) printf("  lng    =length [%d]\n",llng);
 	FetchData(&part,&mprt,&nprt,PARTHANDLE);
 	lprt=mprt*nprt;
-	if (verbose) printf("  part   =length [%d]\n",lprt);
 	FetchData(&data,&mdata,&ndata,DATAHANDLE);
-	if (verbose) printf("  data   =size [%d x %d]\n",mdata,ndata);
 	FetchData(&cmap,&mcmap,&ncmap,CMAPHANDLE);
-	if (verbose) printf("  cmap   =size [%d x %d]\n",mcmap,ncmap);
 	FetchData(&filnam,FILENAME);
-	if (verbose) printf("  filnam =\"%s\"\n",filnam);
-
-	if (verbose) printf("Parsing options:\n");
-	options=new Options(NRHS,nrhs,prhs);
-//	if (options->Size()) for(i=0;i<options->Size();i++) ((Option*)options->GetObjectByOffset(i))->DeepEcho();
+	FetchData(&options,NRHS,nrhs,prhs);
 
 	/*some checks*/
-	if (verbose) printf("Checking inputs:\n");
+	for (i=0; i<melem*nelem; i++) if(elem[i]>nnodes) nnodes=elem[i];
+	if(part) for (i=0; i<lprt; i++) if (part[i]+1 > nparts) nparts=part[i]+1;
 
-	for (i=0; i<melem*nelem; i++)
-		if (elem[i] > nnodes)
-			nnodes=elem[i];
-	if (verbose) printf("  nnodes =%d\n",nnodes);
-	if (part)
-		for (i=0; i<lprt; i++)
-			if (part[i]+1 > nparts)
-				nparts=part[i]+1;
-	if (verbose) printf("  nparts =%d\n",nparts);
-
-	if      (nodecon && (mncon != nnodes))
+	if (nodecon && (mncon != nnodes))
 		_error_("Nodal connectivity table, if supplied, must be supplied for all nodes.");
 	else if (!nodecon)
@@ -136,25 +98,10 @@
 	if (cmap && (ncmap != 3))
 		_error_("Colormap matrix, if supplied, must have three columns for rgb.");
-
 	if (!strlen(filnam))
 		strcpy(filnam,"stdout");
 
-	if (verbose) printf("Opening file \"%s\".\n",filnam);
+	/* Run core computations: */
 	fid=fopen(filnam,"w");
-
-	/* Run core computations: */
-	if (verbose) printf("Calling core:\n");
-	KMLMeshWritex(&ierror,
-				  name,
-				  notes,
-				  elem,melem,nelem,
-				  nodecon,mncon,nncon,
-				  lat,lng,
-				  part,
-				  data,mdata,ndata,
-				  cmap,mcmap,ncmap,
-				  fid);
-
-	if (verbose) printf("Closing file \"%s\".\n",filnam);
+	KMLMeshWritex(&ierror,name,notes,elem,melem,nelem,nodecon,mncon,nncon,lat,lng,part,data,mdata,ndata,cmap,mcmap,ncmap,fid);
 	fclose(fid);
 
@@ -170,6 +117,5 @@
 }
 
-void KMLMeshWriteUsage(void)
-{
+void KMLMeshWriteUsage(void){
 	_printf_(true,"KMLMeshWrite - KML mesh writer module:\n");
 	_printf_(true,"\n");
@@ -196,3 +142,2 @@
 	_printf_(true,"\n");
 }
-
Index: /issm/trunk-jpl/src/modules/KMLOverlay/KMLOverlay.cpp
===================================================================
--- /issm/trunk-jpl/src/modules/KMLOverlay/KMLOverlay.cpp	(revision 12048)
+++ /issm/trunk-jpl/src/modules/KMLOverlay/KMLOverlay.cpp	(revision 12049)
@@ -30,26 +30,19 @@
 
 	/*checks on arguments on the matlab side: */
-	if (nlhs > NLHS) {
-		KMLOverlayUsage();
-		_error_("KMLOverlay usage error");
+	if(nlhs>NLHS){
+		KMLOverlayUsage(); _error_("KMLOverlay usage error");
 	}
-	if (nrhs < NRHS) {
-		KMLOverlayUsage();
-		_error_("KMLOverlay usage error");
+	if(nrhs<NRHS){
+		KMLOverlayUsage(); _error_("KMLOverlay usage error");
 	}
 
 	/*Input datasets: */
-	if (verbose) printf("Fetching inputs:\n");
 	FetchData(&filkml,FILENAME);
-	if (verbose) printf("  filkml=\"%s\"\n",filkml);
+	FetchData(&options,NRHS,nrhs,prhs);
 
-	if (verbose) printf("Parsing options:\n");
-	options=new Options(NRHS,nrhs,prhs);
-//	if (options->Size()) for(i=0;i<options->Size();i++) ((Option*)options->GetObjectByOffset(i))->DeepEcho();
 	options->Get(&lataxis ,&nlat ,"lataxis" );
 	if (verbose && lataxis) for (i=0; i<nlat; i++) printf("  lataxis [%d]=%g\n",i,lataxis[i]);
 	options->Get(&longaxis,&nlong,"longaxis");
 	if (verbose && longaxis) for (i=0; i<nlong; i++) printf("  longaxis[%d]=%g\n",i,longaxis[i]);
-//	((Option*)options->GetOption("images"))->DeepEcho();
 	options->Get(&pimages,&nimages,"images");
 	if (verbose && pimages) for (i=0; i<nimages; i++) printf("  pimages[%d]=\"%s\"\n",i,pimages[i]);
@@ -58,28 +51,22 @@
 
 	/*some checks*/
-	if (verbose) printf("Checking inputs:\n");
-
-	if (nlat  != 2) _error_("Latitudinal axes \"lataxis\" require two double values, not %d.",nlat);
-	if (nlong != 2) _error_("Longitudinal axes \"longaxis\" require two double values, not %d.",nlong);
+	if (nlat !=2) _error_("Latitudinal axes \"lataxis\" require two double values, not %d.",nlat);
+	if (nlong!=2) _error_("Longitudinal axes \"longaxis\" require two double values, not %d.",nlong);
 	if (!nimages) _error_("No image files provided.");
 
-	if ((int)dzip) {
+	if ((int)dzip){
 		filkmz=filkml;
-		filkml=(char *) xmalloc(8*sizeof(char));
+		filkml=(char*)mxMalloc(8*sizeof(char));
 		strcpy(filkml,"doc.kml");
 	}
 
-	if (!strlen(filkml))
-		strcpy(filkml,"stdout");
+	if(!strlen(filkml)) strcpy(filkml,"stdout");
 
-	if (verbose) printf("Opening kml overlay file \"%s\".\n",filkml);
+	if(verbose) printf("Opening kml overlay file \"%s\".\n",filkml);
 	fid=fopen(filkml,"w");
 
 	/* Run core computations: */
 	if (verbose) printf("Calling core:\n");
-	KMLOverlayx(&ierror,
-				lataxis,longaxis,
-				nimages,pimages,
-				fid);
+	KMLOverlayx(&ierror,lataxis,longaxis,nimages,pimages,fid);
 
 	if (verbose) printf("Closing file \"%s\".\n",filkml);
@@ -88,5 +75,5 @@
 	/* Create kmz file, if specified: */
 	if ((int)dzip) {
-		czip=(char *) xmalloc((5+strlen(filkmz)+1+strlen(filkml)+1)*sizeof(char));
+		czip=(char*)mxMalloc((5+strlen(filkmz)+1+strlen(filkml)+1)*sizeof(char));
 		czip[0]='\0';
 		strcat(czip,"!zip ");
@@ -96,5 +83,5 @@
 		for (i=0; i<nimages; i++)
 			if (strlen(pimages[i]) && strncmp(pimages[i],"http",4)) {
-				czip=(char *) xrealloc(czip,(strlen(czip)+1+strlen(pimages[i])+1)*sizeof(char));
+				czip=(char*)mxRealloc(czip,(strlen(czip)+1+strlen(pimages[i])+1)*sizeof(char));
 				strcat(czip," ");
 				strcat(czip,pimages[i]);
@@ -125,6 +112,5 @@
 }
 
-void KMLOverlayUsage(void)
-{
+void KMLOverlayUsage(void){
 	_printf_(true,"KMLOverlay - KML file overlay module:\n");
 	_printf_(true,"\n");
@@ -147,3 +133,2 @@
 	_printf_(true,"\n");
 }
-
Index: /issm/trunk-jpl/src/modules/Kml2Exp/Kml2Exp.cpp
===================================================================
--- /issm/trunk-jpl/src/modules/Kml2Exp/Kml2Exp.cpp	(revision 12048)
+++ /issm/trunk-jpl/src/modules/Kml2Exp/Kml2Exp.cpp	(revision 12049)
@@ -11,5 +11,4 @@
 	char    *filkml=NULL,*filexp=NULL;
 	int     sgn;
-
 	Options* options=NULL;
 	double   cm=0.,sp=0.;
@@ -23,24 +22,16 @@
 	/*checks on arguments on the matlab side: */
 	if (nlhs > NLHS) {
-		Kml2ExpUsage();
-		_error_("Kml2Exp usage error");
+		Kml2ExpUsage(); _error_("Kml2Exp usage error");
 	}
 	if (nrhs < NRHS) {
-		Kml2ExpUsage();
-		_error_("Kml2Exp usage error");
+		Kml2ExpUsage(); _error_("Kml2Exp usage error");
 	}
 
 	/*Input datasets: */
-	if (verbose) printf("Fetching inputs:\n");
 	FetchData(&filkml,KML_IN);
-	if (verbose) printf("  filkml=\"%s\"\n",filkml);
 	FetchData(&filexp,EXP_IN);
-	if (verbose) printf("  filexp=\"%s\"\n",filexp);
 	FetchData(&sgn,SGN_IN);
-	if (verbose) printf("  sgn=%d\n",sgn);
+	FetchData(&options,NRHS,nrhs,prhs);
 
-	if (verbose) printf("Parsing options:\n");
-	options=new Options(NRHS,nrhs,prhs);
-	if (options->Size()) for(i=0;i<options->Size();i++) ((Option*)options->GetObjectByOffset(i))->DeepEcho();
 	/*  defaults are in Ll2xydef, so don't duplicate them here, and only use user values if both have been specified  */
 	if (options->GetOption("central_meridian") || options->GetOption("standard_parallel")) {
@@ -52,19 +43,13 @@
 
 	/*some checks*/
-	if (verbose) printf("Checking inputs:\n");
-
-	if (sgn != +1 && sgn != -1) _error_("Hemisphere sgn=%d must be +1 (north) or -1 (south).",sgn);
+	if (sgn !=+1 && sgn!= -1) _error_("Hemisphere sgn=%d must be +1 (north) or -1 (south).",sgn);
 	if (fabs(cm)      > 180.) _error_("Central meridian cm=%g must be between -180 (west) and +180 (east) degrees.",cm);
 	if (sp < 0. || sp >  90.) _error_("Standard parallel sp=%g must be between 0 and 90 degrees (in specified hemisphere).",sp);
 
 	/* Run core computations: */
-	if (verbose) printf("Calling core:\n");
 	if (options->GetOption("central_meridian") && options->GetOption("standard_parallel"))
-		iret=Kml2Expx(filkml,filexp,
-					  sgn,cm,sp);
+		iret=Kml2Expx(filkml,filexp,sgn,cm,sp);
 	else
-		iret=Kml2Expx(filkml,filexp,
-					  sgn);
-	if (verbose) printf("  iret=%d\n",iret);
+		iret=Kml2Expx(filkml,filexp,sgn);
 
 	/*Write data: */
@@ -80,6 +65,5 @@
 }
 
-void Kml2ExpUsage(void)
-{
+void Kml2ExpUsage(void){
 	_printf_(true,"Kml2Exp - kml to exp file conversion module:\n");
 	_printf_(true,"\n");
Index: /issm/trunk-jpl/src/modules/Ll2xy/Ll2xy.cpp
===================================================================
--- /issm/trunk-jpl/src/modules/Ll2xy/Ll2xy.cpp	(revision 12048)
+++ /issm/trunk-jpl/src/modules/Ll2xy/Ll2xy.cpp	(revision 12049)
@@ -25,32 +25,18 @@
 	/*checks on arguments on the matlab side: */
 	if (nlhs > NLHS) {
-		Ll2xyUsage();
-		_error_("Ll2xy usage error");
+		Ll2xyUsage(); _error_("Ll2xy usage error");
 	}
 	if (nrhs < NRHS) {
-		Ll2xyUsage();
-		_error_("Ll2xy usage error");
+		Ll2xyUsage(); _error_("Ll2xy usage error");
 	}
 
 	/*Input datasets: */
-	if (verbose) printf("Fetching inputs:\n");
 	FetchData(&lat,&nlat,LAT_IN);
-	if (verbose)
-		if   (nlat == 1) printf("  lat=%g\n",lat[0]);
-		else             printf("  lat=[%d values]\n",nlat);
-//	for (i=0; i<nlat; i++) printf("  lat[%d]=%g\n",i,lat[i]);
 	FetchData(&lon,&nlon,LON_IN);
-	if (verbose)
-		if   (nlon == 1) printf("  lon=%g\n",lon[0]);
-		else             printf("  lon=[%d values]\n",nlon);
-//	for (i=0; i<nlon; i++) printf("  lon[%d]=%g\n",i,lon[i]);
 	FetchData(&sgn,SGN_IN);
-	if (verbose) printf("  sgn=%d\n",sgn);
+	FetchData(&options,NRHS,nrhs,prhs);
 
-	if (verbose) printf("Parsing options:\n");
-	options=new Options(NRHS,nrhs,prhs);
-	if (options->Size()) for(i=0;i<options->Size();i++) ((Option*)options->GetObjectByOffset(i))->DeepEcho();
 	/*  defaults are in Ll2xydef, so don't duplicate them here, and only use user values if both have been specified  */
-	if (options->GetOption("central_meridian") || options->GetOption("standard_parallel")) {
+	if(options->GetOption("central_meridian") || options->GetOption("standard_parallel")){
 		options->Get(&cm,"central_meridian");
 		if (verbose) printf("  cm=%g\n",cm);
@@ -61,6 +47,5 @@
 	/*some checks*/
 	if (verbose) printf("Checking inputs:\n");
-
-	if   (nlat != nlon) _error_("Must have same number of lat[%d] and lon[%d] coordinates.",nlat,nlon);
+	if (nlat != nlon) _error_("Must have same number of lat[%d] and lon[%d] coordinates.",nlat,nlon);
 	else                ncoord=nlat;
 	if (sgn != +1 && sgn != -1) _error_("Hemisphere sgn=%d must be +1 (north) or -1 (south).",sgn);
@@ -68,18 +53,12 @@
 	if (sp < 0. || sp >  90.) _error_("Standard parallel sp=%g must be between 0 and 90 degrees (in specified hemisphere).",sp);
 
-	x=(double *)xmalloc(ncoord*sizeof(double));
-	y=(double *)xmalloc(ncoord*sizeof(double));
+	x=(double*)mxMalloc(ncoord*sizeof(double));
+	y=(double*)mxMalloc(ncoord*sizeof(double));
 
 	/* Run core computations: */
-	if (verbose) printf("Calling core:\n");
 	if (options->GetOption("central_meridian") && options->GetOption("standard_parallel"))
-		iret=Ll2xyx(x,y,
-					lat,lon,ncoord,
-					sgn,cm,sp);
+		iret=Ll2xyx(x,y,lat,lon,ncoord,sgn,cm,sp);
 	else
-		iret=Ll2xyx(x,y,
-					lat,lon,ncoord,
-					sgn);
-	if (verbose) printf("  iret=%d\n",iret);
+		iret=Ll2xyx(x,y,lat,lon,ncoord,sgn);
 
 	/*Write data: */
@@ -94,6 +73,5 @@
 }
 
-void Ll2xyUsage(void)
-{
+void Ll2xyUsage(void){
 	_printf_(true,"Ll2xy - lat/long to x/y coordinate transformation module:\n");
 	_printf_(true,"\n");
@@ -119,3 +97,2 @@
 	_printf_(true,"\n");
 }
-
Index: /issm/trunk-jpl/src/modules/Shp2Kml/Shp2Kml.cpp
===================================================================
--- /issm/trunk-jpl/src/modules/Shp2Kml/Shp2Kml.cpp	(revision 12048)
+++ /issm/trunk-jpl/src/modules/Shp2Kml/Shp2Kml.cpp	(revision 12049)
@@ -18,5 +18,4 @@
 	char    *filshp=NULL,*filkml=NULL;
 	int     sgn;
-
 	Options* options=NULL;
 	double   cm=0.,sp=0.;
@@ -34,24 +33,16 @@
 	/*checks on arguments on the matlab side: */
 	if (nlhs > NLHS) {
-		Shp2KmlUsage();
-		_error_("Shp2Kml usage error");
+		Shp2KmlUsage(); _error_("Shp2Kml usage error");
 	}
 	if (nrhs < NRHS) {
-		Shp2KmlUsage();
-		_error_("Shp2Kml usage error");
+		Shp2KmlUsage(); _error_("Shp2Kml usage error");
 	}
 
 	/*Input datasets: */
-	if (verbose) printf("Fetching inputs:\n");
 	FetchData(&filshp,SHP_IN);
-	if (verbose) printf("  filshp=\"%s\"\n",filshp);
 	FetchData(&filkml,KML_IN);
-	if (verbose) printf("  filkml=\"%s\"\n",filkml);
 	FetchData(&sgn,SGN_IN);
-	if (verbose) printf("  sgn=%d\n",sgn);
+	FetchData(&options,NRHS,nrhs,prhs);
 
-	if (verbose) printf("Parsing options:\n");
-	options=new Options(NRHS,nrhs,prhs);
-	if (options->Size()) for(i=0;i<options->Size();i++) ((Option*)options->GetObjectByOffset(i))->DeepEcho();
 	/*  defaults are in Xy2lldef, so don't duplicate them here, and only use user values if both have been specified  */
 	if (options->GetOption("central_meridian") || options->GetOption("standard_parallel")) {
@@ -63,6 +54,4 @@
 
 	/*some checks*/
-	if (verbose) printf("Checking inputs:\n");
-
 	if (sgn < -1 || sgn > +1) _error_("Hemisphere sgn=%d must be +1 (north), -1 (south), or 0 (no translation).",sgn);
 	if (fabs(cm)      > 180.) _error_("Central meridian cm=%g must be between -180 (west) and +180 (east) degrees.",cm);
@@ -70,12 +59,8 @@
 
 	/* Run core computations: */
-	if (verbose) printf("Calling core:\n");
 	if (options->GetOption("central_meridian") && options->GetOption("standard_parallel"))
-		iret=Shp2Kmlx(filshp,filkml,
-					  sgn,cm,sp);
+		iret=Shp2Kmlx(filshp,filkml,sgn,cm,sp);
 	else
-		iret=Shp2Kmlx(filshp,filkml,
-					  sgn);
-	if (verbose) printf("  iret=%d\n",iret);
+		iret=Shp2Kmlx(filshp,filkml,sgn);
 
 	/*Write data: */
@@ -91,6 +76,5 @@
 }
 
-void Shp2KmlUsage(void)
-{
+void Shp2KmlUsage(void){
 	_printf_(true,"Shp2Kml - shp to kml file conversion module:\n");
 	_printf_(true,"\n");
@@ -115,3 +99,2 @@
 	_printf_(true,"\n");
 }
-
Index: /issm/trunk-jpl/src/modules/Xy2ll/Xy2ll.cpp
===================================================================
--- /issm/trunk-jpl/src/modules/Xy2ll/Xy2ll.cpp	(revision 12048)
+++ /issm/trunk-jpl/src/modules/Xy2ll/Xy2ll.cpp	(revision 12049)
@@ -12,5 +12,4 @@
 	int     nx,ny,ncoord;
 	int     sgn;
-
 	Options* options=NULL;
 	double   cm=0.,sp=0.;
@@ -25,30 +24,16 @@
 	/*checks on arguments on the matlab side: */
 	if (nlhs > NLHS) {
-		Xy2llUsage();
-		_error_("Xy2ll usage error");
+		Xy2llUsage(); _error_("Xy2ll usage error");
 	}
 	if (nrhs < NRHS) {
-		Xy2llUsage();
-		_error_("Xy2ll usage error");
+		Xy2llUsage(); _error_("Xy2ll usage error");
 	}
 
 	/*Input datasets: */
-	if (verbose) printf("Fetching inputs:\n");
 	FetchData(&x,&nx,X_IN);
-	if (verbose)
-		if   (nx == 1) printf("  x=%g\n",x[0]);
-		else           printf("  x=[%d values]\n",nx);
-//	for (i=0; i<nx; i++) printf("  x[%d]=%g\n",i,x[i]);
 	FetchData(&y,&ny,Y_IN);
-	if (verbose)
-		if   (ny == 1) printf("  y=%g\n",y[0]);
-		else           printf("  y=[%d values]\n",ny);
-//	for (i=0; i<ny; i++) printf("  y[%d]=%g\n",i,y[i]);
 	FetchData(&sgn,SGN_IN);
-	if (verbose) printf("  sgn=%d\n",sgn);
+	FetchData(&options,NRHS,nrhs,prhs);
 
-	if (verbose) printf("Parsing options:\n");
-	options=new Options(NRHS,nrhs,prhs);
-	if (options->Size()) for(i=0;i<options->Size();i++) ((Option*)options->GetObjectByOffset(i))->DeepEcho();
 	/*  defaults are in Xy2lldef, so don't duplicate them here, and only use user values if both have been specified  */
 	if (options->GetOption("central_meridian") || options->GetOption("standard_parallel")) {
@@ -60,6 +45,4 @@
 
 	/*some checks*/
-	if (verbose) printf("Checking inputs:\n");
-
 	if   (nx != ny) _error_("Must have same number of x[%d] and y[%d] coordinates.",nx,ny);
 	else            ncoord=nx;
@@ -68,18 +51,13 @@
 	if (sp < 0. || sp >  90.) _error_("Standard parallel sp=%g must be between 0 and 90 degrees (in specified hemisphere).",sp);
 
-	lat=(double *)xmalloc(ncoord*sizeof(double));
-	lon=(double *)xmalloc(ncoord*sizeof(double));
+	lat=(double*)mxMalloc(ncoord*sizeof(double));
+	lon=(double*)mxMalloc(ncoord*sizeof(double));
 
 	/* Run core computations: */
 	if (verbose) printf("Calling core:\n");
 	if (options->GetOption("central_meridian") && options->GetOption("standard_parallel"))
-		iret=Xy2llx(lat,lon,
-					x,y,ncoord,
-					sgn,cm,sp);
+		iret=Xy2llx(lat,lon,x,y,ncoord,sgn,cm,sp);
 	else
-		iret=Xy2llx(lat,lon,
-					x,y,ncoord,
-					sgn);
-	if (verbose) printf("  iret=%d\n",iret);
+		iret=Xy2llx(lat,lon,x,y,ncoord,sgn);
 
 	/*Write data: */
@@ -94,6 +72,5 @@
 }
 
-void Xy2llUsage(void)
-{
+void Xy2llUsage(void){
 	_printf_(true,"Xy2ll - x/y to lat/long coordinate transformation module:\n");
 	_printf_(true,"\n");
