edit function advance