 
 	if (v1 < n && v2 < n)
         {
-        	d[v1 * pitch + v2] = current_d[ty][tx];
-		p[v1 * pitch + v2] = current_p[ty][tx];
+        	d[cell_current] = current_d[ty][tx];
+		p[cell_current] = current_p[ty][tx];
         }
 }
 

	else
	{
        	#pragma unroll
		FOR(j, 0, BLOCK_SIZE - 1)
		{
			newPath = current_d[ty][j] + primary_d[j][tx];
			
			__syncthreads();
			if (newPath < current_d[ty][tx])
			{
				current_d[ty][tx] = newPath;
				current_p[ty][tx] = primary_p[j][tx];
			}
		        
			// Synchronize to make sure that all value are current in block

*/
void print_graph(const unsigned int n, const int * const G)
{
	int v1, v2;
	FOR(v1, 0, n - 1)
	{
		FOR(v2, 0, n - 1) 
