add main logic