Added analysis code to look at generations