 			for (int CurrNodeOffset=d_RowPtr[threadID]; CurrNodeOffset<d_RowPtr[threadID+1] ; CurrNodeOffset++){
 				// Mark the neighbor's colors unavailable by
 				// pushing them into the NeighborColors vector
-				int NodeColor = d_ColorVector[d_ColIdx[CurrNodeOffset]];
+				int NodeIndex = d_ColIdx[CurrNodeOffset];
+				int NodeColor = d_ColorVector[NodeIndex];
 				NeighborColors[NumNeighbors++] = NodeColor;
 			}
 			// Here, we have the neighbor's colors


// Init the ColorValid array
// TODO: Replace with one thrust::fill call
__global__ void InitializeColorVector(int d_NumVertices, bool* d_ColorValid){
	int threadID = blockIdx.x * blockDim.x + threadIdx.x;
	if (threadID < d_NumVertices){
		d_ColorValid[threadID] = false;	
	}
}


	int threadID = blockIdx.x * blockDim.x + threadIdx.x;
	// Temp storage to store the neighbors' colors. 
	int NeighborColors[MAX_DEGREE];
	// Set the default value of changed to false
	*d_changed = false;
	if (threadID < d_NumVertices) { 
		// So that we dont walk over the edge of the d_RowPtr array
		if (d_ColorVector[threadID] == NO_COLOR){
			// if the vertex is not colored
