Recursive sum and last index done