Added counter class, other useful methods