 }
 
 
+// Each thread launched with this kernel will check if it is in a region border pixel. If it is
+// it will run 40 iterations of the serial grow algorithm from the TA. Each block of the gpu will
+// use a shared memory during the 40 iterations and syncronize with eachother when they are all done.
+// TODO: This currently doesn't do anything. It should be fixed.
 __global__ void region_grow_kernel_shared(unsigned char* data, unsigned char* region, int* finished){
   int x = blockIdx.x * blockDim.x + threadIdx.x;
   int y = blockIdx.y * blockDim.y + threadIdx.y;

  return region;
}


__global__ void raycast_kernel(unsigned char* data, unsigned char* image, unsigned char* region){

  // Camera/eye position, and direction of viewing. These can be changed to look

  image[(y+(IMAGE_DIM/2)) * IMAGE_DIM + (x+(IMAGE_DIM/2))] = color > 255 ? 255 : color;
}

// Trilinear interpolation from the region texture
__device__ float value_at_region(float3 pos){
  if(!inside(pos)){
    return 0;
