rewrote getcounters()