rewrote windows detection