added edit function.