make it work for more than one generation