add some debug messages
Writing to output file
Need to read the last byte to find out what the final offset is