Add nbrs function and basic bfs