Resolved a bug related buffered greedy algorithm