python 3 fix: dict.iteritems() doesn't exist