replaced iteritems() with items()