added counter class for python 2.6