Completed problem2.py