Updated to produce max sum sub range indices

Updated to produce max sum sub range indices