more writing, there is a mistake with BFS