I think this was copied from `get_stop_indices`- can you plz update Uncle Greg?