Window also appears on Windows. Also, main loop now has logical parts