two feature generation function