replace magic number with checksum