index and total are not optional in reduce callbacks