main part of income loop