greedy metho