change iteritems to items for python 3 support.