mods to ex1.py