works for sparse matrix? I don't think it's the case