document and test count method