Add remove_det function.