Updated sn.py to the final version w/ comments