   fa2UpdateTract(gid, numvertices, forceX, forceY, oldForceX, oldForceY, tra);
 
   // Update speed of vertices.
-  fa2UpdateSpeed(gid, numvertices, speed, swg, forceX, forceY, graphSpeed);
+  fa2UpdateSpeed(gid, numvertices, &speed, swg, forceX, forceY, graphSpeed);
 
   // Update displacement of vertices.
   fa2UpdateDisplacement(gid, numvertices, speed, forceX, forceY, &dispX, &dispY);

  cudaMalloc(&numNeighbours, g->numvertices * sizeof(int));
  cudaMalloc(&tra, g->numvertices * sizeof(float));
  cudaMalloc(&swg, g->numvertices * sizeof(float));
  cudaMalloc(&speed, g->numvertices * sizeof(float));
  cudaMalloc(&oldForceX, g->numvertices * sizeof(float));
  cudaMalloc(&oldForceY, g->numvertices * sizeof(float));
  cudaMalloc(&graphSwing, sizeof(float));

__device__ void fa2SaveOldForces(unsigned int gid, unsigned int numvertices,
    float forceX, float forceY, float* oldForceX, float* oldForceY);
__device__ void fa2UpdateDisplacement(unsigned int gid,
    unsigned int numvertices, float speed, float forceX, float forceY,
    float* dispX, float* dispY);
__device__ void fa2UpdateLocation(unsigned int gid, unsigned int numvertices,
    float* vxLocs, float* vyLocs, float xdisp, float ydisp);
