greedy working