Update sm.py

Eliminated unnecessary code.