Simplified array_to_sum