fixed reading of file

-open in binary mode
-use unformatted extractions so leading whitespace isn't skipped