untested implementation of breadth first path finding