implemented the count printing