finish remove() code