Improved BreadthFirstSearch to work for more Sensors