bread-first search implemented