modify generate.py for spec