Separated bfs functions into separate file bfs.c/.h