    }
 
    //Get top left most neuron in the group
-   __shared__ long localStartSourceExt;
-   if(localXIndex == 0 && localYIndex == 0 && localFIndex == 0){
-      localStartSourceExt = params.startSourceExtBuf[kTargetRes];
-   }
-
-   //long startSourceExt = params.startSourceExtBuf[kTargetRes];
+   //__shared__ long localStartSourceExt;
+   //if(localXIndex == 0 && localYIndex == 0 && localFIndex == 0){
+   //   localStartSourceExt = params.startSourceExtBuf[kTargetRes];
+   //}
+
+   long startSourceExt = params.startSourceExtBuf[kTargetRes];
 
    int localIndex = kIndex(localXIndex, localYIndex, localFIndex, localX, localY, localF);
 

   //params.numXfBufs = params.numXfBufs < params.nyp ? params.numXfBufs : params.nyp;  
   //params.numXfBufs = 1;

   params.preBufNum = params.localBufSizeX * params.nfp;
   params.weightsBufNum = params.nxp * params.nfp;

   size_t sharedSize = sizeof(float) * (params.preBufNum + params.postBufNum + params.weightsBufNum);

   if(sharedSize > device->get_local_mem()){
      printf("gpu post run: given shared memory size of %zu is bigger than allowed shared memory size of %zu\n", sharedSize, device->get_local_mem());

      //The actual pre buffer index
      __syncthreads();

      float* activityY = &(params.preData[startSourceExt + ky * params.sy]);
      //float* activityY = &(preBuffer[xOffset * params.nfp]);
      //float* activityY = &(preBuffer[(ky+yOffset) * params.localBufSizeX * params.nfp + xOffset*params.nfp]);

      float* weightY = weightsBuffer;
