change greedy to importable module

add main.py as usage example