add clean_ds function