Modified extra credit ex35ex.py