added a count method to more efficiently get the number of items in a set