Finalized delete_all function