added functionality to compact counter