 
 	string data_folder = "./garbage";
 
-	sys.fullJacobian = 1;
+	sys->fullJacobian = 1;
 	double length = 1;
 	double r = .02;
 	double rho = 2200;
 	double nu = .3;
 
 	if(argc>1) {
-	  sys.setNumPartitions((int)atoi(argv[1]));
+	  sys->setNumPartitions((int)atoi(argv[1]));
     numElementsPerSide = atoi(argv[2]);
-    sys.setSolverType((int)atoi(argv[3]));
-    sys.setPrecondType(atoi(argv[4]));
+    sys->setSolverType((int)atoi(argv[3]));
+    sys->setPrecondType(atoi(argv[4]));
     if(atoi(argv[4])) {
-      sys.preconditionerUpdateModulus = precUpdateInterval;
-      sys.preconditionerMaxKrylovIterations = precMaxKrylov;
+      sys->preconditionerUpdateModulus = precUpdateInterval;
+      sys->preconditionerMaxKrylovIterations = precMaxKrylov;
     }
     E = atof(argv[5]);
     data_folder = argv[6];

bool showSphere = 1;

// Create the system (placed outside of main so it is available to the OpenGL code)
ANCFSystem sys;

#ifdef WITH_GLUT
OpenGLCamera oglcamera(camreal3(-1,1,-1),camreal3(0,0,0),camreal3(0,1,0),.01);


		oglcamera.Update();

		for (int i = 0; i < sys->particles.size(); i++) {
			glColor3f(0.0f, 1.0f, 0.0f);
			glPushMatrix();
			float3 pos = sys->getXYZPositionParticle(i);
			glTranslatef(pos.x, pos.y, pos.z);
			glutSolidSphere(sys->particles[i].getRadius(), 30, 30);
			glPopMatrix();

			//indicate velocity
			glLineWidth(sys->elements[i].getRadius()*500);
			glColor3f(1.0f,0.0f,0.0f);
			glBegin(GL_LINES);
			glVertex3f(pos.x,pos.y,pos.z);
			float3 vel = sys->getXYZVelocityParticle(i);
			//cout << "v:" << vel.x << " " << vel.y << " " << vel.z << endl;
			pos +=2*sys->particles[i].getRadius()*normalize(vel);
			glVertex3f(pos.x,pos.y,pos.z);
			glEnd();
			glFlush();
		}

		for(int i=0;i<sys->elements.size();i++)
		{
			int xiDiv = sys->numContactPoints;

			double xiInc = 1/(static_cast<double>(xiDiv-1));

