Bugfix and paremeters adaptation
Adapt the mspai code