add sparse matrix implementation (not yet finished)