iterating through dict items().  Added some comments to clearify steps.