just basic BFS implementation and troubleshooting.