fixed ex3.py