added example
more main/cashflow refactoring