     {
         /* Station index J of baseline I,J */
         int sJ = sJ0 + (blockIdx.y * STATION_BLOCK_SIZE) + threadIdx.x;
-
-        /* Initialise per baseline vis */
-        Vpq_sum[threadIdx.x].a = make_float2(0.0f, 0.0f);
-        Vpq_sum[threadIdx.x].b = make_float2(0.0f, 0.0f);
-        Vpq_sum[threadIdx.x].c = make_float2(0.0f, 0.0f);
-        Vpq_sum[threadIdx.x].d = make_float2(0.0f, 0.0f);
 
         if (sJ < num_stations)
         {

            __syncthreads();

            /* Accumulate per source visibilities into per chunk visibilities */
            if (threadIdx.x == 0 && idxStationJ < num_stations)
            {
                for (int i = 0; i < blockDim.x; ++i)
                {
                    int tacc = (sb*num_sources) + i;
                    if (tacc < num_sources)
                    {
                        Vpq_sum[j].a.x += Vpq_source[i].a.x;
                        Vpq_sum[j].a.y += Vpq_source[i].a.y;
                        Vpq_sum[j].b.x += Vpq_source[i].b.x;
                        Vpq_sum[j].b.y += Vpq_source[i].b.y;
                        Vpq_sum[j].c.x += Vpq_source[i].c.x;
                        Vpq_sum[j].c.y += Vpq_source[i].c.y;
                        Vpq_sum[j].d.x += Vpq_source[i].d.x;
                        Vpq_sum[j].d.y += Vpq_source[i].d.y;
                    }
                }
            } /* Accumulate to baseline for the source chunk */
        } /* Loop over other stations that make up the baseline (I-J) */
    } /* Loop over blocks of sources */

    /* Write final visibilities to global memory */
    if (threadIdx.x < STATION_BLOCK_SIZE)
    {
        /* Index of baseline visibility */
        int sJ = sJ0 + (blockIdx.y * STATION_BLOCK_SIZE) + threadIdx.x;
        int idx = sJ * (num_stations-1) - (sJ-1) * sJ/2 + blockIdx.x - sJ -1;
        /* Add result of this thread block to the baseline visibility. */
        vis[idx] = Vpq_sum[threadIdx.x];
    }
} /* version 2 */



    int max_station_blocks = (num_stations + block_size - 1) / block_size;
    dim3 num_blocks(num_stations, max_station_blocks);
    size_t shared_mem = num_threads.x * sizeof(float4c); /* acc. buffer */
    oskar_correlate_point_time_smearing_cudak_2_f
    OSKAR_CUDAK_CONF(num_blocks, num_threads, shared_mem)
    (num_sources, num_stations, d_jones, d_source_I, d_source_Q, d_source_U,
