added a reduction API