fixed out of bound ss2 matrix