Change assert to assert_true
Refactored sparsefuncs