Cleaned up sparse matrix mul function