Add main logic