initial checksum logic