Changes to main.

In main, changed .items to .iteritems throughout.