Changing to Breadth-first search

So the shortest solution will always be found, not the first one.