Updated templates, and generate.py, tested generation