moved *_cnt function to end of module (so that documetation ends up at end)