 						predecessor = primaryRow_p[k][idx];
 					}
 				}
-                		d[cell] = path;
-		                p[cell] = predecessor;
+                		d[block] = path;
+		                p[block] = predecessor;
 			}
 		}
 	}

	int newPath;
	int newPred;

	int tx = threadIdx.x; 
	int ty = threadIdx.y;
	
	int v1 = BLOCK_SIZE * block + ty;
	int v2 = BLOCK_SIZE * block + tx;  

	const int cell = v1 * pitch + v2;


		{
			idx = tx + j;
			idy = ty + i;
		
			if (v1Row + i < n && v2 + j < n)
			{
				block = (v1Row + i) * pitch + v2 + j;
 		
				primaryRow_d[idy][idx] = d[block];
				primaryRow_p[idy][idx] = p[block];
			}
			else
			{
				primaryRow_d[idy][idx] = INF;
				primaryRow_p[idy][idx] = NONE;
			}
		
			if (v1 + i  < n && v2Col + j < n)
			{
				block = (v1 + i) * pitch + v2Col + j;
				primaryCol_d[idy][idx] = d[block];
			}
			else
			{
