Added counts calculation/tracking

not tested