Fixed regression #216 from function1 to function2.
Preformance now matches PIM-SM SSM.