simplified compute_generations
simplified compute_generations