removed iteritems for items (equivalent) and in some cases moved to enuerate