Implemented local beam search