more main logic