Add sum function to range_sum to get total of array