Implemented remove all ending spaces.