- implemented edit function