added binary file reader and writer