some tricks to make lazy greedy work