Completed ex13.py