Create main-logic