bugfix: don't extend zero-length intervals!
bfs to keep depth