added default value for reduce(sum) as no default with empty array causes an error