Create main logic.