adds counter for number of generations