first bfs search...needs verifying though.