Updated Checksum function