trying to write display function