Use counter as a return int