It seems that the greedy-type method finally works