 
 __device__ void fa2UpdateSpeedGraph(float gswing, float gtract, float* gspeed)
 {
-  // This code is executed by one thread.
-  if (threadIdx.x + blockIdx.x == 0)
-  {
     float oldSpeed = *gspeed;
     *gspeed = gswing > 0 ? TAU * (gtract / gswing) : EPSILON;
     if (*gspeed <= 0)

  float* dispY = NULL;
  float* graphSwing = NULL;
  float* graphTract = NULL;

  float* vxLocs = NULL;
  float* vyLocs = NULL;

  cudaMalloc(&dispY, g->numvertices * sizeof(float));
  cudaMalloc(&graphSwing, sizeof(float));
  cudaMalloc(&graphTract, sizeof(float));
  cudaMalloc(&graphSpeed, sizeof(float));

  cudaMemset(numNeighbours, 0, g->numvertices * sizeof(int));
  cudaMemset(tra, 0, g->numvertices * sizeof(float));
