   int dz[6] = {0,0,0,0,-1,1};
   int3 pixel = pop(stack);
   for(int n = 0; n < 6; n++){
-    int3 candidate = pixel;
-    candidate.x += dx[n];
-    candidate.y += dy[n];
-    candidate.z += dz[n];
-
-    if(!inside(candidate)){
-      continue;
-    }
-
-    if(region[candidate.z * DATA_DIM*DATA_DIM + candidate.y*DATA_DIM + candidate.x]){
-      continue;
-    }
-
-    if(similar(data, pixel, candidate)){
-      push(stack, candidate);
-      region[candidate.z * DATA_DIM*DATA_DIM + candidate.y*DATA_DIM + candidate.x] = 1;
-    }
-  }
-
-}*/
+  int3 candidate = pixel;
+  candidate.x += dx[n];
+  candidate.y += dy[n];
+  candidate.z += dz[n];
+
+  if(!inside(candidate)){
+  continue;
+  }
+
+  if(region[candidate.z * DATA_DIM*DATA_DIM + candidate.y*DATA_DIM + candidate.x]){
+  continue;
+  }
+
+  if(similar(data, pixel, candidate)){
+  push(stack, candidate);
+  region[candidate.z * DATA_DIM*DATA_DIM + candidate.y*DATA_DIM + candidate.x] = 1;
+  }
+  }
+
+  }*/
 
 
 __global__ void region_grow_kernel_shared(unsigned char* data, unsigned char* region, int* finished){

  return v;
}

float3 add(float3 a, float3 b){
  a.x += b.x;
  a.y += b.y;
  a.z += b.z;

}

// Checks if position is inside the volume (float3 and int3 versions)
__global__ int inside(float3 pos){
  int x = (pos.x >= 0 && pos.x < DATA_DIM-1);
  int y = (pos.y >= 0 && pos.y < DATA_DIM-1);
  int z = (pos.z >= 0 && pos.z < DATA_DIM-1);
