Made the program stop with a counter