switched to binary file mode for windows compat

Now works on Windows too.