added scipy sparse matrix conversion