modified generate.py to take arguments