edited generate.py