Index: /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.h	(revision 26142)
+++ /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.h	(revision 26143)
@@ -19,14 +19,14 @@
 class ElementMatrix{
 
+	private:
+		int *gglobaldoflist;
+		int *fglobaldoflist;
+		int *sglobaldoflist;
+		int  fsize;
+		int  ssize;
+
 	public:
-
-		int      nrows;
-		int      fsize;
-		int      ssize;
-		IssmDouble*  values;
-
-		int*     gglobaldoflist;
-		int*     fglobaldoflist;
-		int*     sglobaldoflist;
+		int         nrows;
+		IssmDouble *values;
 
 		/*ElementMatrix constructors, destructors*/
Index: /issm/trunk-jpl/src/c/classes/matrix/ElementVector.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/matrix/ElementVector.cpp	(revision 26142)
+++ /issm/trunk-jpl/src/c/classes/matrix/ElementVector.cpp	(revision 26143)
@@ -21,5 +21,4 @@
 
 	this->nrows=0;
-	this->fsize=0;
 	this->values=NULL;
 	this->fglobaldoflist=NULL;
@@ -28,8 +27,4 @@
 /*}}}*/
 ElementVector::ElementVector(ElementVector* pe1, ElementVector* pe2){/*{{{*/
-
-	/*intermediaries*/
-	int i,j;
-	int gsize,fsize;
 
 	/*If one of the two matrix is NULL, we copy the other one*/
@@ -50,8 +45,8 @@
 
 	/*1: Get the new numbering of pe2 and get size of the new matrix*/
-	gsize=pe1->nrows;
-	for(i=0;i<pe2->nrows;i++){
+	int gsize=pe1->nrows;
+	for(int i=0;i<pe2->nrows;i++){
 		bool found=false;
-		for(j=0;j<pe1->nrows;j++){
+		for(int j=0;j<pe1->nrows;j++){
 			if(pe2->gglobaldoflist[i]==pe1->gglobaldoflist[j]){
 				found=true; P[i]=j; break;
@@ -70,10 +65,10 @@
 	this->fglobaldoflist=xNew<int>(this->nrows);
 	this->values=xNewZeroInit<IssmDouble>(this->nrows);
-	for(i=0;i<pe1->nrows;i++){
+	for(int i=0;i<pe1->nrows;i++){
 		this->values[i] += pe1->values[i];
 		this->gglobaldoflist[i]=pe1->gglobaldoflist[i];
 		this->fglobaldoflist[i]=pe1->fglobaldoflist[i];
 	}
-	for(i=0;i<pe2->nrows;i++){
+	for(int i=0;i<pe2->nrows;i++){
 		this->values[P[i]] += pe2->values[i];
 		this->gglobaldoflist[P[i]]=pe2->gglobaldoflist[i];
@@ -81,8 +76,4 @@
 	}
 
-	/*Fset*/
-	this->fsize=0;
-	for(i=0;i<this->nrows;i++) if(this->fglobaldoflist[i]>=0) this->fsize++;
-
 	/*clean-up*/
 	xDelete<int>(P);
@@ -111,9 +102,6 @@
 	this->values=xNewZeroInit<IssmDouble>(this->nrows);
 
-	/*g list*/
+	/*dof list*/
 	this->gglobaldoflist=GetGlobalDofList(nodes,numnodes,GsetEnum,approximation);
-
-	/*Get fsize*/
-	this->fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation);
 	this->fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation);
 }
@@ -132,5 +120,8 @@
 	this->CheckConsistency();
 
-	if(this->fsize){
+	/*Get size of Fset*/
+   int fsize = 0; for(int i=0;i<this->nrows;i++) if(this->fglobaldoflist[i]>=0) fsize++;
+
+	if(fsize){
 		pf->SetValues(this->nrows,this->fglobaldoflist,this->values,ADD_VAL);
 	}
@@ -155,5 +146,4 @@
 	_printf_("Element Vector echo:\n");
 	_printf_("   nrows: " << nrows << "\n");
-	_printf_("   fsize: " << fsize << "\n");
 	_printf_("   values:\n");
 	for(i=0;i<nrows;i++) _printf_(setw(4) << right << i << ": " << setw(10) << values[i] << "\n");
@@ -164,5 +154,5 @@
 
 	_printf_("   fglobaldoflist (" << fglobaldoflist << "): ");
-	if(fglobaldoflist) for(i=0;i<fsize;i++) _printf_(" " << fglobaldoflist[i] );
+	if(fglobaldoflist) for(i=0;i<nrows;i++) _printf_(" " << fglobaldoflist[i] );
 	_printf_(" \n");
 }
@@ -173,5 +163,4 @@
 
 	this->nrows =pe->nrows;
-	this->fsize =pe->fsize;
 
 	this->values=xNew<IssmDouble>(this->nrows);
@@ -187,5 +176,8 @@
 void ElementVector::InsertIntoGlobal(Vector<IssmDouble>* pf){/*{{{*/
 
-	if(this->fsize){
+	/*Get size of Fset*/
+	int fsize = 0; for(int i=0;i<this->nrows;i++) if(this->fglobaldoflist[i]>=0) fsize++;
+
+	if(fsize){
 		/*add local values into global  vector, using the fglobaldoflist: */
 		pf->SetValues(this->nrows,this->fglobaldoflist,this->values,INS_VAL);
@@ -196,7 +188,5 @@
 void ElementVector::SetValue(IssmDouble scalar){/*{{{*/
 
-	int i;
-
-	for(i=0;i<this->nrows;i++)this->values[i]=scalar;
+	for(int i=0;i<this->nrows;i++)this->values[i]=scalar;
 
 }
Index: /issm/trunk-jpl/src/c/classes/matrix/ElementVector.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/matrix/ElementVector.h	(revision 26142)
+++ /issm/trunk-jpl/src/c/classes/matrix/ElementVector.h	(revision 26143)
@@ -20,10 +20,11 @@
 class ElementVector{
 
+	private:
+		int *gglobaldoflist;
+		int *fglobaldoflist;
+
 	public:
 		int         nrows;
-		int         fsize;
 		IssmDouble *values;
-		int        *gglobaldoflist;
-		int        *fglobaldoflist;
 
 		/*ElementVector constructors, destructors*/
