more work on windows, still some bugs to fix