sparsity pattern solution working