Change file writing method to use IO.binwrite, for speed