modifed to work on windows