modified to work on windows