   }
   __syncthreads();
   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);
       shared[threadIdx.x]._accLack.Add(shared[threadIdx.x + remains]._accLack);

    }
    __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();
  uint32_t remains = blockDim.x >> 1;
  for (; remains >= 1; remains >>= 1) {
    if (threadIdx.x < remains) {
      sum[threadIdx.x].Add(sum[threadIdx.x + remains]);
    }
    __syncthreads();
  }
  const taNumber normalizer = 1 / sum[0].Get();
  iTarget = threadIdx.x;
  while (iTarget < rak._nTargets) {
