featuregen code