first attempts at a graph searching algorithm