working on breaking up file into packets and writing