added checksum code