added MP detection procedure