Completed problem2.py with annotations