a more-finished delete function