modified ModelMain