got BFS working