make_intervals function

create an intervals object