write the definition of a class counter containing