Rewriting the findMatchedPath function back to returning a Stack.

Saves time/memory converting between LinkedHashSet and Stack.