more tests and bfs corrected