Allowed whitespace at the end of input lines

Before, any characters after the input would cause a failure message.
Now, I added the trim method to eliminate all whitespace.  If the
entire excess is whitespace, it treats the input as if the whitespace
didn’t exist and processes the input.