added matrix counter class