modified to work in Windows