changed the display and main loop