Completed editing function