add functions of loss and checksum