Implemented new generation function.