coding, rework edit function

From Claudyus's repository