Function getGeneration