creating bfs visitor
added test functions, changed weight parameter to input by value as it takes a default