a rough beginning of the display method, plus some refactoring of the sorting