initial sparse matrix implementation