Got rid of Delay, replaced with waitEvent.

This way it closes when you hit close, and you don't have to wait 5
seconds every time.