Not working, trying a more brute force breadth first approach.
Not entirely happy, but it does work.