Finished hw5.py