fixed nasty windows bug.  need to open files as binary wb or rb or else all is lost!