moved display function