reviewed saf function (no more based on the article)