reduce dictionary