Sparse matrices and dictionaries now working