almost done with simple counting