Clean up run, make window a global