editing doc function