added a delegate method shouldWalk which allows clients to terminate recursion early