ex30.py modified