add function to save and load sparse matrix