Finally got greedy working