added checksum calculation