Updated ex3.py