added greedy to main.cpp