Changed begin and end stripping to include trailing space