added the option to toggle the display function