Added a checksum function