Greedy algor done