Use iteritems() for compat with python3