optimizations

count numsteps by batch