Windows support

To say I dunno how to make code more universal but current addition seems to work on both *nix and win platforms.