   cudaMemset(dispY, 0, g->numvertices * sizeof(float));
   cudaMemset(graphSwing, 0, sizeof(float));
   cudaMemset(graphTract, 0, sizeof(float));
+  cudaMemset(graphSpeed, 0, sizeof(float));
 
   cudaMalloc(&vxLocs, g->numvertices * sizeof(float));
   cudaMalloc(&vyLocs, g->numvertices * sizeof(float));

        dispX,
        dispY,
        graphSwing,
        graphTract);
  }

  // Update graph with new vertex positions.

  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));
