work on GreedySearch