added Greedy algorithm