SM: final version