modified for win32 build