I refactored the code to update the crc and write to the file
I refactored stuff