work on sparsed matrix