Updated to work on Windows