code that might work for windows