Changes iteritems to items for Py3 compatibility