fix counter and add tests
add comment
var name update
get count value early
Merge pull request #15 from craigtaub/fixCounter

Fix counter and add tests