Extended the count method.