Added a count method.