minor code updates to allow BFS to be called easier