Python3 uses dict.items() instead of dict.iteritems()