Alg is not correct
printing the matrix for S option