Update gen.py to reflect scheam changes