removed BFS from main loop and added it too own class