Update sgen.py, see sgen-new.py