SSM Algorithm