added functions for writing in binary
writes A and B chunks in binary to files! needs to be cleaned up and setup as a script. possibly optimized using numpy