work in progress -- still converting sparse to dense code and tests, and fixing some docstrings