greedy search added