Established counting functionality.