Implement editing function