Finding endpoints almost works, working on connecting via shortest paths.