     }
     __syncthreads(); // get the shared data in all threads
     remains = blockDim.x >> 1;
-    for (; remains > KernelLaunchContext::_cWarpSize; remains >>= 1) {
+    for (; remains >= 1; remains >>= 1) {
       if (threadIdx.x < remains) {
         shared[threadIdx.x]._accLhEnt.Add(shared[threadIdx.x + remains]._accLhEnt);
       }
       __syncthreads();
     }
-    if (threadIdx.x < KernelLaunchContext::_cWarpSize) {
-      for (; remains >= 1; remains >>= 1) {
-        if (threadIdx.x < remains) {
-          shared[threadIdx.x]._accLhEnt.Add(shared[threadIdx.x + remains]._accLhEnt);
-        }
-      }
-    }
-    __syncthreads(); // Ensure that all threads get updated shared[0]
     const taNumber Wk = shared[0]._accLhEnt.Get();
     if (threadIdx.x == 0) {
       accTotW.Add(Wk);

    }
    __syncthreads(); // get the shared data in all threads
    remains = blockDim.x >> 1;
    for (; remains > KernelLaunchContext::_cWarpSize; remains >>= 1) {
      if (threadIdx.x < remains) {
        shared[threadIdx.x]._accLhEnt.Add(shared[threadIdx.x + remains]._accLhEnt);
        shared[threadIdx.x]._accLack.Add(shared[threadIdx.x + remains]._accLack);

    }
    __syncthreads();
  }
  if (threadIdx.x == 0) {
    const taNumber totW = accTotW.Get(); // actually this must be equal to 1 (+-)
    const taNumber normalizer = 1 / totW;
    const taNumber avgH = -shared[0]._accLhEnt.Get() * normalizer;
    const taNumber avgL = -shared[0]._accLack.Get() * normalizer;
    const taNumber avgV = shared[0]._accVelocity.Get() * normalizer;
    const taNumber nExpectedTargets = exp2(avgH);
    const taNumber vComp = CalcVelocityComponent(avgV, nqk._nTargets);
    nqk._pTotals[iQuestion] = intPow(avgL, 1)
      * intPow(vComp, 9)
      * intPow(nExpectedTargets, -2);
  }
}

