 				   const InType* __restrict__  d_in,
 				   OutType*                    d_out) {
     int batch_no = blockIdx.x;
+    int pol_no = threadIdx.y;
+    
     extern __shared__ int shared[];
     int* xdata = shared;
-    int* ydata = xdata + nbaseline;
-
+    int* ydata = xdata + nbaseline * npol;
+    
     for(int i = threadIdx.x; i < nbaseline; i += blockDim.x){
-	xdata[i] = *(x + batch_no * nbaseline + i);
-	ydata[i] = *(y + batch_no * nbaseline + i);
+	    xdata[i] = *(x + batch_no * nbaseline * npol + pol_no + npol * i);
+	    ydata[i] = *(y + batch_no * nbaseline * npol + pol_no + npol * i);
     }
 
     __syncthreads();
     
-    int pol_no = threadIdx.y;
     for(int i = threadIdx.x; i < maxsupport * maxsupport; i += blockDim.x) {
         int myU = i % maxsupport;
         int myV = i / maxsupport;

            }
            
            //TODO: Re-do the w-kernel/gcf for our data.
            OutType px = kernels[vi*maxsupport*maxsupport + myConvV * maxsupport + myConvU];// ??
            // Sum up
            InType temp = d_in[vi+vi_s];
            OutType vi_v = OutType(temp.x, temp.y);

        int vi_s = batch_no*nbaseline*npol+pol_no;
        int grid_s = batch_no*npol*gridsize*gridsize + pol_no*gridsize*gridsize;
        int vi = 0;
        for(vi = 0; vi < (nbaseline*npol); vi+=npol) {
            int xl = x[vi+vi_s];
            int yl = y[vi+vi_s];
            
            // Determine convolution point. This is basically just an
            // optimised way to calculate.
            //int myConvU = myU - u;
