Added checksum calculation