Adding close on X button with display event_queue. Adding explanation comments