implemented class counter