added toggle to switch between display and edit modes