added term-document sparse matrix support