added greedy.c