is the change just making d >= path[depth + 1].getDefLevel instead of d > path[depth].getDefLevel?

I can see that this works from the test, but can you explain why this works? Just for my edification