Update reduce method

It is now possible to pass an initial value to the reduce method.