main loop, creates window that can be closed