added basic binary file read and write. resolved some normalization bugs