function generational_replacement