Add edit mode functionality