Breadth First search algorythm