adding beam search