fix greedy