BFS works but not correctly. Also, it's currently ver slow