rewrote display functionality into main