More work on greedy.c