Better iteration pattern for dictionaries
Cleaned up imports and removed debug statements