 bool showSphere = 1;
 
 // Create the system (placed outside of main so it is available to the OpenGL code)
-ANCFSystem sys;
+ANCFSystem* sys;
 
 #ifdef WITH_GLUT
 OpenGLCamera oglcamera(camreal3(-1,1,-1),camreal3(0,0,0),camreal3(0,1,0),.01);

	    element = Element(Node(j*length, 0, i*length, 0, 0, 1),
	        Node(j*length, 0, (i+1)*length, 0, 0, 1),
	        r, nu, E, rho);
	    sys.addElement(&element);
	    k++;
	    if(k%100==0) printf("Elements %d\n",k);
	  }
	}

	// Fix corners to ground
	sys.addConstraint_AbsoluteSpherical(sys.elements[0], 0);
	sys.addConstraint_AbsoluteSpherical(sys.elements[2*numElementsPerSide*(numElementsPerSide+1)-numElementsPerSide], 0);
	sys.addConstraint_AbsoluteSpherical(sys.elements[numElementsPerSide*(numElementsPerSide+1)-numElementsPerSide], 0);
	sys.addConstraint_AbsoluteSpherical(sys.elements[2*numElementsPerSide*(numElementsPerSide+1)-1], 1);
	sys.addConstraint_AbsoluteSpherical(sys.elements[numElementsPerSide*(numElementsPerSide+1)-1], 1);

	// Constrain x-strands together
	for(int j=0; j < numElementsPerSide+1; j++)
	{
	  for(int i=0; i < numElementsPerSide-1; i++)
	  {
	    sys.addConstraint_RelativeFixed(
	        sys.elements[i+j*numElementsPerSide], 1,
	        sys.elements[i+1+j*numElementsPerSide], 0);
	  }
	}


	{
	  for(int i=0; i < numElementsPerSide-1; i++)
	  {
	    sys->addConstraint_RelativeFixed(
	        sys->elements[i+offset+j*numElementsPerSide], 1,
	        sys->elements[i+offset+1+j*numElementsPerSide], 0);
	  }
	}

