Moved win_setup to top of file