add count function to container.