add generation function