finished checksum function