Completed code for do_remove_entry