2 conditions for greedy