wrote a simple token counter