update function display() in class linstack