added a counter class