Added the edit function