   float *childParent, float *parentChildren, 
   int nInput, int rootId, int maxFamilyPath, int maxDept, float scale)
 {
-  __shared__ float buffer[SOFTMAXTREE_THREADS+1];
+  __shared__ float buffer[SOFTMAXTREE_THREADS];
   int tx = threadIdx.x;
   int i_step = blockDim.x;
   int k = blockIdx.x;

      for (int j=0; j<nChildren; j++)
      {
        // multiply accumulate weights
        nodeGradWeight[j*nInput + i] += scale*nodeGrad[j]*buffer[tx];
      }
    }
    
    // cadd bias
    for (int i=tx; i<nChildren; i+=i_step)
    {
      // multiply accumulate weights
      nodeGradBias[i] += scale*nodeGrad[i]
    }
    
    // keep track of which node gets gradients

    /* get next Node in Tree */
    node = childParent + childId*2;
    parentId = (int)node[0] - 1;
    
    node = parentChildren + parentId*2;
    parentIdx = (int)node[0] - 1;
