Major refactor, start of BFS
Major refactor, start of BFS