polyfill for reduce