         {
             static __shared__ scalar shared_min[32]; // Shared mem for 32 partial minmax comparisons
             static __shared__ scalar shared_max[32]; // Shared mem for 32 partial minmax comparisons
+
             int lane = threadIdx.x % warpSize;
             int wid = threadIdx.x / warpSize;
 


        __global__ void cu_MinMax(const scalar *in, scalar* out_min, scalar* out_max, int N)
        {
            scalar min, max;
            int idx = blockIdx.x * blockDim.x + threadIdx.x;
            if(idx < N)
            {
                scalar val = in[idx];
                blockReduceMinMax(val, &min, &max);

                if (threadIdx.x==0)
                {
                    out_min[blockIdx.x] = min;
                    out_max[blockIdx.x] = max;
                }
            }
        }


        scalar  max_abs_component(const vectorfield & vf)
		{
			// We want the Maximum of Absolute Values of all force components on all images
			// Find minimum and maximum values
			std::pair<scalar,scalar> minmax = minmax_component(vf);
            scalar absmin = std::abs(minmax.first);
            scalar absmax = std::abs(minmax.second);
			// Maximum of absolute values
			return std::max(absmin, absmax);
		}

        __global__ void cu_scale(Vector3 *vf1, scalar sc, size_t N)
