add first version of greedy algorithm