bfs, untested
fixed build so it still compiles