Added reduce method
Added test_reduce