create a display function in demo