Changed so that the code will work better on Windows