Some remarks on greedy algorithms