               // from sptree.cpp
               tmp = 1 / (1 + tmp);
               mult = massd[n] * tmp;
+              // printf("%0.2f\n", massd[n]);
               normsum += mult;
               mult *= tmp;
               vx += dx * mult;

        gpuErrchk(cudaDeviceSynchronize());

        // compute attractive forces
        computeAttrForce(N_POINTS, sparsePij.size(), nnodes, sparse_handle, descr, sparsePij, pijRowPtr, pijColInd, forceProd, pts, attr_forces, ones);
        gpuErrchk(cudaDeviceSynchronize());
        
        norm = thrust::reduce(norml.begin(), norml.begin() + N_POINTS, 0.0f, thrust::plus<float>());

          pd++;

          if (n >= 0) {
            dx = px - posxd[n];
            dy = py - posyd[n];
            // tmp = dx*dx + dy*dy; // distance squared
            tmp = dx*dx + dy*dy + epssqd; // distance squared plus small constant to prevent zeros
            if ((n < nbodiesd) || __all(tmp < dq[depth])) {  // check if all threads agree that cell is far enough away (or is a body)
