Reduce array