add rm_all_but function