add getCount method to make unit testing easier