Adding fromIndex and toIndex for recalculating new interval.