Modified the BFS class..