I modified the signature of the checksum function to be of the standard form (error code out, with output as trailing argument)