the 2nd alg for SS upgraded to handle mismatches