Completed ex37.py