Greedy Alogrithm