Added logic, model and generated code