Add vecreduce function