Modified to make it work in Windows