perform reduce