Added bfs and is_connected