adapted the test case for reduce template