used chaining to trim the input while reading