changed from items to iteritems as the new version of pandas doesn't support it anymore