preparing for sparse matrices