python3 changes, reduce and iteritems