Updated ex6.py