targetIntervals function

Compute target intervals