numpy/vectorized versions of counts (some of it)