worked around issue with sparse matrix size