How the SAMIR functions works