Allow specifying number of generations to compute; indent cleanup