Now works for nested sub intervals