Finished bfs for 2nd try on adjacent graph