if remaining is not greater than 0, assert an error with the message string 'remaining bytes to read should never go negative'.
assert remaining > 0 , 'remaining bytes to read should never go negative'