Width first algortihm