Plugged in Mike's bfs reset function