Implementation of the sparsematrix class. 1st