adding count method, cleaning up counter obj