added get_intervals method