All cases
Start of greedy method