ex13.py with extra credit