No sure you want to make it a function.  After all, you apply it once on the `v` of `depth_first_search`.