Chapter Example: Determining the Length of a Message (version 2)