functioning sparse matrix support (really slow)