Added support for the reduce operation