main logic completed