done greedy algorithm