Fixed greedy issue