modified print/ display function